2
votes

I'm developing a script to download images from tile-based image-hosting. I downloaded tiles using wget and trying to use montage to compine them.

The problem is that I've got tiles with different sizes (last tile in row is more narrow than the others). Here is combine command:

montage $temp/*.jpg -tile $maxcolumn"x"$maxrow -geometry -1-1 -quality 100% merged.jpg

ImageMagick aligns tiles by grid and produces this image (see right and bottom sides).

image http://leftparagraphs.ru/!/merged.jpg

How do I fix this with montage?

2

2 Answers

3
votes

Fixed by specifying "-mode Concatenate".

Also I have to run another instance of convert after montage to "-trim" resulting image.

0
votes

This solution did not work for me. To combine two different height images into one, I first used the identify command to get the height of the largest image (1280 pixels):

identify large.jpg

Then I used the following command to resize the smaller image and combine it side by side with the larger one:

montage -tile 2x1 -geometry +0+0 small.jpg"[x1280]" large.jpg output.jpg