0

我目前正在使用以下 ImageMagick 命令从多个 JPG 图像创建照片的“宝丽来堆栈”。

convert \
    img-5.jpg -thumbnail 300x200 -bordercolor white -border 10 \
    -bordercolor grey60 -border 1 -bordercolor none \
    -background none -rotate -4 \
    \
    \( img-2.jpg -thumbnail 300x200 -bordercolor white -border 10 \
       -bordercolor grey60 -border 1 -bordercolor none \
       -background none -rotate 6 \
    \) \
    \
    \( img-3.jpg -thumbnail 300x200 -bordercolor white -border 10 \
       -bordercolor grey60 -border 1 -bordercolor none \
       -background none -rotate -2 \
    \) \
    \
    \( img-1.jpg -thumbnail 300x200 -bordercolor white -border 10 \
       -bordercolor grey60 -border 1 -bordercolor none \
       -background none -rotate -4 \
    \) \
    \
    \( img-4.jpg -thumbnail 300x200 -bordercolor white -border 10 \
       -bordercolor grey60 -border 1 -bordercolor none \
       -background none -rotate 4 \
    \) \
    \
    -border 100x80 -gravity center +repage -flatten -trim +repage \
    -background black \( +clone -shadow 60x4+4+4 \) +swap -background none \
    -flatten stack.png

此命令生成以下图像:

宝丽来堆栈

我想要做的是使图像偏离旋转选项当前使用的中心轴,以便照片之间有更多的水平(可能还有一点垂直)分离。

更具体地说,我希望能够通过将它们向左和向右移动(也许有点上下)来看到更多显示在最顶部图像边缘周围的底层图像。

我可以在上面的转换调用中添加哪些命令来实现这一点?

4

2 回答 2

1
-repage geometry

Adjust the canvas and offset information of the image.

这是 imagemagick.org http://www.imagemagick.org/Usage/layers/#layer_prog的一个很好的例子

于 2013-04-21T01:59:41.310 回答
0

感谢@Iamiuru 让我走上正轨。不幸的是,仅靠 -repage 是不够的,我不得不在其他地方进行一些调整以使其正常工作。

这是我最终使用的命令:

convert \
    img-5.jpg -thumbnail 300x200 -bordercolor white -border 10 \
    -bordercolor grey60 -border 1 -bordercolor none \
    -background none -rotate 3 -repage -20-5 \
    \
    \( img-2.jpg -thumbnail 300x200 -bordercolor white -border 10 \
       -bordercolor grey60 -border 1 -bordercolor none \
       -background none -rotate -5 -repage -10+0 \
    \) \
    \
    \( img-3.jpg -thumbnail 300x200 -bordercolor white -border 10 \
       -bordercolor grey60 -border 1 -bordercolor none \
       -background none -rotate 4 -repage -30+10 \
    \) \
    \
    \( img-1.jpg -thumbnail 300x200 -bordercolor white -border 10 \
       -bordercolor grey60 -border 1 -bordercolor none \
       -background none -rotate -4 -repage +20-10 \
    \) \
    \
    \( img-4.jpg -thumbnail 300x200 -bordercolor white -border 10 \
       -bordercolor grey60 -border 1 -bordercolor none \
       -background none -rotate 2 \
    \) \
    \
    -border 100x80 -flatten -trim +repage -background black \
    \( +clone -shadow 60x4+4+4 \) +swap -background none -flatten stack.png

从我的原始命令中,我不得不删除这些-gravity center +repage选项,因为这些选项只是将所有图像重新居中到其原始位置,并且 -repage 不起作用。

此命令生成以下图像:

带偏移的宝丽来堆栈

于 2013-04-21T20:20:09.537 回答