Is it possible to combine 4 Images into one png??????

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
lepagano

Is it possible to combine 4 Images into one png??????

Post by lepagano »

Hello All,

I was curious if it is possible to combine four images (.pngs) into a nice four panel image (.png)? I heard the convert -combine command is only good for 2 images. Does anyone have any ideas??

Thank you.

Regards,

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

Re: Is it possible to combine 4 Images into one png??????

Post by fmw42 »

what exactly do you mean by combine 4 images? how do you want them combined?

the IM command -combine takes 3 or 4 grayscale images and merges them as channels to form an rgb and optionally alpha channel image or a cmyk image. Each image becomes a channel in the result (either r,g,b,a or c,m,y,k)

Do want them overlaid in some way rather than combine channels?

Do you want the images to be placed next to each other (side-by-side or one above the other) rather than combine channels?

Please clarify!!!
wildbug
Posts: 21
Joined: 2008-06-18T12:53:24-07:00

Re: Is it possible to combine 4 Images into one png??????

Post by wildbug »

Try the montage command:

http://www.imagemagick.org/script/montage.php
http://www.imagemagick.org/Usage/montage/

You can adjust the borders/width between images, what order, how many rows/columns, etc.
lepagano

Re: Is it possible to combine 4 Images into one png??????

Post by lepagano »

Thanks for the replies...

All I need is to put four separate images into one image which has 4 panels- two rows, two columns (therefore, one for each image). I am trying to compare all four images and want to keep them exactly the same except for the size since i am trying to put 4 into one image. No overlaying. Just side by side. Let me know!

Thanks so much...

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

Re: Is it possible to combine 4 Images into one png??????

Post by fmw42 »

see -append to put them top/bottom and +append to put them side to side

http://www.imagemagick.org/script/comma ... php#append

I presume they are the same size?

convert \( image1 image2 -append \) \
\( image3 image4 -append \) +append result

see parenthesis processing at http://www.imagemagick.org/Usage/basics/#image_seq


If on Windows, see http://www.imagemagick.org/Usage/windows/
lepagano

Re: Is it possible to combine 4 Images into one png??????

Post by lepagano »

Thank you... This worked great!!
Post Reply