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.
Post Reply
mickey

How to make collage?

Post by mickey » 2008-07-14T01:39:17-07:00

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: 1017
Joined: 2005-03-21T21:16:57-07:00

Re: How to make collage?

Post by el_supremo » 2008-07-14T07:25:59-07:00

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 » 2015-10-28T08:36:30-07:00

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: 22102
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: How to make collage?

Post by fmw42 » 2015-10-28T09:26:17-07:00

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 » 2015-10-28T11:03:31-07:00

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: 22102
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: How to make collage?

Post by fmw42 » 2015-10-28T14:40:41-07:00

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 » 2015-10-29T06:14:56-07:00

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

Post Reply