3

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.

  • Image 1 is 100px high.
  • Image 2 is 200px high.

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

Terence Eden
  • 14,034
  • 3
  • 48
  • 89

1 Answers1

3

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.

Mark Setchell
  • 191,897
  • 31
  • 273
  • 432