无缝连接PNG一个在另一个之上

问题描述:

如何使用ImageMagick(可能是montage命令)将png图像连接到一个新的png中,其中每个输入png都成为最后一个png的一部分?全部垂直排列?无缝连接PNG一个在另一个之上

像这样:大致相等的宽度(±2像素)和不同高度的

2的PNG接合在彼此无缝的顶部。

我真的不介意发生过多/更小的宽度。

convert 1.png 2.png -append result.png 
  • 要对齐左侧边缘,增加-gravity West
  • 要对齐右边缘,请添加-gravity East
  • 要对齐中心,请添加-gravity center

要添加一个透明隔板之间:

convert -background none 1.png -size 10x10 xc:none 2.png -append result.png 

哦,你已经走了水平!将-append更改为+append

这一个:

convert -append img1.png img2.png out.png 

例如从

enter image description here

enter image description here

会得到

enter image description here

而且:

convert +append img1.png img2.png out2.png 

会产生

enter image description here