imagemagickimagemagick-montage

imagemagick montage - how to align images to bottom


I want to create a montage, using ImageMagick, where all the images are aligned to the bottom. The images have different heights, and -gravity South doesn't behave as I expect.

If I use :

montage *.png -tile 2x1 -background None -geometry +20+0 -gravity South out/montage.png

I get:

enter image description here

If I add a third image, of 50px high, and run

montage *.png -tile 3x1 -geometry +20+0 -gravity South montage2.jpg

I get:

enter image description here

I understand what's happening here - the canvas is expanding from the bottom. Is there any way to get it to grow from the top, so that the image looks like:

enter image description here


Solution

  • enter image description here

    You can just use +smush (documentation) for that:

    convert -background white -gravity south [abc].png +smush 10 result.png
    

    If using Imagemagick v7, replace convert with magick.