如何在没有外部依赖性的情况下在Ruby中生成图像? [英] How can I generate an image in Ruby without external dependencies?
问题描述
我想在我的Rails应用程序之外使用我自己的数据在Google地图上实现热图。为此,我需要根据我的数据为每个地图坐标(平铺)生成叠加图像。
I want to implement heat maps over Google maps with my own data beyond my Rails application. To do this I need to generate overlay images for each map coordinate (tile) based on my data.
我发现如何使用ImageMagick生成它,但我不想依赖于此,因为我打算在几个地方分发我的应用程序,所以我想做这只使用Ruby语言。
I found how to generate that using ImageMagick but I do not want to depend on this, because I plan to distribute my application in several places, so I would like to do this using only the Ruby language.
请注意,我只需要在一个小透明方块上绘制不同颜色的点。
Note that I need only to plot points in different colors over an small transparent square.
推荐答案
我认为 chunky_png 或 oily_png 将是您最好的选择。它没有ImageMagick的外部依赖关系,并以Web可用的格式生成图像。
I think chunky_png or oily_png will be your best bet on this. It has no external dependencies on ImageMagick, and generates images in a web-usable format.
这篇关于如何在没有外部依赖性的情况下在Ruby中生成图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!