Reputation: 837
I have 100 parts of an image and I want to merge them into one. How can I do it from command line, using tools like Imagemagick's convert or montage.
The input is small parts of an image, like this:
And the output is:
Upvotes: 0
Views: 1148
Reputation: 53081
In Imagemagick, you can use the montage tool to merge an (MxN) array of tiles.
montage image01 image02 ... imageXX -tile MxN -geometry +0+0 result
If the images are in alphabetic order and say png, then
montage *.png -tile XxY -geometry +0+0 result.png
See https://www.imagemagick.org/Usage/montage/
Here is an example reducing the size by 50%
Input (repeated 4 times):
montage lena.jpg -duplicate 3 -tile 2x2 -geometry 50x50+0+0% lena_montage.jpg
Upvotes: 3
Reputation: 1724
You can combine images vertically or horizontally using convert
from ImageMagick:
convert *.PNG -append output.PNG
and if you need something faster, use GraphicMagick:
gm convert *.PNG -append output.PNG
You can use, -append
for vertical and +append
for horizontal attach. Since you need both of these options, my not-a-very-clever solution would be creating the rows first, and them combining those rows vertically to get the final result.
Upvotes: 0