achieving equal size logos in montage

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
rcasey
Posts: 3
Joined: 2011-06-14T09:05:12-07:00
Authentication code: 8675308

achieving equal size logos in montage

Post by rcasey »

Greetings,

This is a basic question for the gurus, but I'm kind of stumped, after trying several things, and searching this excellent forum; but here's my question...

I'm trying to get 5 different logos to the same height size, then put them into a montage, which gets used on my client's homepage. I know to use the "convert filename.png -resize 'x200' newfile.gif" to get them all the same size. I use 'identify' to verify that the 5 files are indeed all the same height...yet when I montage them all together into a 5x1 tile:

montage -tile 5x1 -background none file1 file2 ... montage_filename.gif

They still come out looking different heights? The result can be seen here: http://www.thisairsealedhome.com/index.html, where the five logos are seen along the bottom of the screen.

Any suggestions as the cause of my (newbie) error?

(BTW, ImageMagick is an amazing resource...just discovered it a month or so ago...)
Thanks! --rick
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: achieving equal size logos in montage

Post by Bonzo »

That is strange try this instead:

Code: Select all

convert newfile.gif newfile1.gif newfile2.gif newfile3.gif +append montage_filename.gif
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: achieving equal size logos in montage

Post by fmw42 »

what IM version and platform are you using? can you post links to the five input images? It is possible that your png files have virtual canvas sizes different from the input image. So when resizing you might add +repage after the input image and see if that helps. Also in your montage command try putting the input image first before the other arguments.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: achieving equal size logos in montage

Post by fmw42 »

The issue is explained in the montage docs (http://www.imagemagick.org/Usage/montage/) where it says:

"The default "-geometry" setting is '120x120>+4+3' which means to fit any image given into a box 120x120 pixel in size. If the image is larger shrink it, but don't resize smaller images (as per the Only Shrink Larger ('>') Flag. The 'tile' size is then set to the largest dimentions of all the resized images, and the size actually specified. That means you will never get a tile size that is smaller than the specified "-geometry" size."

So to avoid any resizing you must specify a -geometry with just offsets. For example:


convert logo: -resize x200 logo_tmp1.png
convert rose: -resize x200 rose_tmp1.png

This gives results like you are getting:
montage logo_tmp1.png rose_tmp1.png -tile 2x1 -background none logo_rose_montage.gif
Image

But adding -geometry gives proper results:
montage logo_tmp1.png rose_tmp1.png -tile 2x1 -background none -geometry +5+5 logo_rose_montage.gif
Image
Last edited by fmw42 on 2011-06-14T10:51:39-07:00, edited 2 times in total.
rcasey
Posts: 3
Joined: 2011-06-14T09:05:12-07:00
Authentication code: 8675308

Re: achieving equal size logos in montage

Post by rcasey »

Thanks for the quick replies. Will try out these suggestions, and post result.

I found a bug? Wow...I'm honored! :? ...looks like your example works though...
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: achieving equal size logos in montage

Post by fmw42 »

rcasey wrote:Thanks for the quick replies. Will try out these suggestions, and post result.

I found a bug? Wow...I'm honored! :? ...looks like your example works though...
Look again. I just edited my post. It is not a bug. It is an issue that you need to specify a -geometry.
rcasey
Posts: 3
Joined: 2011-06-14T09:05:12-07:00
Authentication code: 8675308

Re: achieving equal size logos in montage

Post by rcasey »

Cool...thanks Fred! Will try that out (this forum is terrific!) --rick
Post Reply