How to make collage?

MagickWand for PHP is an object-oriented PHP interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning MagickWand for PHP.
Locked
mickey

How to make collage?

Post by mickey »

Hi..

Im am trying to make a collage of some different pictures..

What i want is like

[] [] [] []
[] [] [] []
[] [] [] []
[] [] [] []

each "box" is supposed to be a picture..

The way i have tried to do it is with this code:

Code: Select all

convert -resize 100x100! test.jpg test2.jpg test3.jpg test4.jpg +append test.jpg test2.jpg test3.jpg test4.jpg +append test_image.jpg
What happens is that it makes the first 4 photo's 100x100 like it have to do an they are all vertically..
The problem now is that the next 4 pictures dont move underneeth, and they are at their original size aswell :S

Hope someone is able to help me out :)

- Regards
Mike

el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: How to make collage?

Post by el_supremo »

Try the montage command instead of convert.
See: http://www.imagemagick.org/Usage/montage/

Pete

zenkovnick
Posts: 3
Joined: 2015-10-28T08:30:04-07:00
Authentication code: 1151

Re: How to make collage?

Post by zenkovnick »

Hello, I understand, that a lot of time has passed since last message, but I need help to build such type of collage: 2x2, for three images
C1 C2
R1 [ ][ ]
R2 [ ][ ]

but R1C1 and R2C2 tiles are merged and 1 image is placed there, R1C2 and R2C2 - separate tiles and contain another 2 images
Something like this: http://www.awesomescreenshot.com/image/ ... 4471614d33

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

Re: How to make collage?

Post by fmw42 »

Sorry, I do not fully understand your input image situation.

But see the append command. http://www.imagemagick.org/Usage/layers/#append

zenkovnick
Posts: 3
Joined: 2015-10-28T08:30:04-07:00
Authentication code: 1151

Re: How to make collage?

Post by zenkovnick »

Input situation - there are 3 images with random sizes, I need to have collage on output, which will have images on positions, provided in screenshot link.

Thanks, will take a look on append command

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

Re: How to make collage?

Post by fmw42 »

In command line, this would be

Code: Select all

convert image1 image2 image3 -background white -append result

zenkovnick
Posts: 3
Joined: 2015-10-28T08:30:04-07:00
Authentication code: 1151

Re: How to make collage?

Post by zenkovnick »

thanks for your help, but append didn't make a trick, but I've found another solution with composite operation:

Code: Select all

convert -size 80x80 xc:white result.png
composite photo_cropped.jpg result.png result.png
composite -geometry 40x40+40+0 photo2_.png result.png result.png
composite -geometry 40x40+40+40 photo3_.png result.png result.png
in a result I've what I wanted

Locked