Stacking same-width different-height imgs vertically

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
gje21c
Posts: 4
Joined: 2011-02-20T14:39:18-07:00
Authentication code: 8675308

Stacking same-width different-height imgs vertically

Post by gje21c »

Hi,
I've had a fair try at this, honest.
I'd like to stack a pile of images vertically. They are the same width but different height.
Eg. img1.png 100x20
img2.png 100x30
img3.png 100x40

to produce out.png 100x90

Tried some variants of montage but can't get it yet.

Thanks !
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Stacking same-width different-height imgs vertically

Post by fmw42 »

please clarify what you mean by stack? Do you want them side by side (horiz or vertical) or do you want them overlaid on top of each other presuming they have transparency.

if side by side vertically (or horizontally) see -append (or +append) and use -gravity to set how you want them justified relative to each other.

see
http://www.imagemagick.org/Usage/layers/#append
http://www.imagemagick.org/script/comma ... hp#gravity
gje21c
Posts: 4
Joined: 2011-02-20T14:39:18-07:00
Authentication code: 8675308

Re: Stacking same-width different-height imgs vertically

Post by gje21c »

Fabulous, that works, thanks. Don't know how I didn't spot that in the tutorial pages.

(I did just want the images stacked "on top" of each other. Not overlaying each other. Hmmm, when you say "vertical" or "on top" it's not 100.00% clear what you want, good lesson. Although I did provide the dimension of the required output image.)

So what I needed was ..

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

Thanks, GE.
Post Reply