Newbie: Centering Image in montage on command line

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
jacktripper1000
Posts: 2
Joined: 2011-08-12T08:24:59-07:00
Authentication code: 8675308

Newbie: Centering Image in montage on command line

Post by jacktripper1000 »

Hi, I am new to using ImageMagick command line interface. I have a image and I want to add a smaller, second image as footer of the first one centered. However when I do that, I am getting it left aligned only.

This is the command I am running.

Code: Select all

montage main.jpg footer.gif -gravity center -tile 1x2 out.jpg
I am not sure what I am missing here.
Please help.

Jack
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Newbie: Centering Image in montage on command line

Post by Bonzo »

Any particular reason you want to use montage?

This should do what you want:

Code: Select all

convert main.jpg footer.gif -gravity south -composite out.jpg
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Newbie: Centering Image in montage on command line

Post by fmw42 »

or

convert main.jpg footer.gif -background somecolor -gravity south -append out.jpg

the -background is only needed it the widths of the two images differ.

see http://www.imagemagick.org/script/comma ... php#append and http://www.imagemagick.org/Usage/layers/#append
jacktripper1000
Posts: 2
Joined: 2011-08-12T08:24:59-07:00
Authentication code: 8675308

Re: Newbie: Centering Image in montage on command line

Post by jacktripper1000 »

Magical!
Works like a charm.

Thanks a lot.

-Jack
Post Reply