我正在使用ImageMagick(通过Ruby中的Dragonfly)并需要转换如下图像:
X
像这样平铺:
XXX
XXX
XXX
并设置宽度(在我的情况下为200像素)。
我将如何做到这一点?
答案 0 :(得分:1)
使用ImageMagick,您将使用tile:
格式加载源图像。
convert -size 200x200 tile:x.png out.png
对于Dragonfly,您需要扩展Dragonfly.app.generate
image = Dragonfly.app.generate(:convert, '-size 200x200 tile:x.png', 'png')