考虑这个例子(Ubuntu 18.04,ImageMagick 6.9.7-4 Q16 x86_64 20170114):
convert -size 300x100 xc:red red.png
convert -size 100x100 xc:blue blue.png
montage red.png blue.png -frame 5 -geometry '+0+0' -tile 1x redblue.png
这给出了以下图像:
我想做的是将蓝色方块移动到“在其瓷砖内”的任意 x 位置;说将蓝色正方形的左边缘对齐到红色矩形宽度的 25%,或 50% - 甚至将蓝色正方形的右边缘与红色矩形的右边缘对齐。
我已经看到它-tile-offset
存在(https://imagemagick.org/script/command-line-options.php#tile-offset),我已经用这个例子试过了,但它看起来没有任何作用。
如何在其磁贴内移动图像(ImageMagick 蒙太奇的一部分)?
编辑:看起来-tile-offset
只能为显式平铺图像指定(不是在 中-tile 1x
,而是在 中-tile red.png
),并且:
-tile-offset 必须在平铺之前。它表示单个全局偏移,而不是平铺的间距。
这是一个例子:
convert -size 300x100 radial-gradient:\#400-\#FAA red.png
convert -size 500x500 xc: -tile-offset +100+40 +size -tile red.png -border 5 -geometry +5+5 -draw "color 0,0 reset" out.png
然后 out.png 是这样的(点击查看完整图片):
...所以澄清一下 - 我想知道它是否可以在获得的图块内移动图像montage
tile 1x