Page 1 of 1

ImageMagick v7 image stacking

Posted: 2016-06-03T22:44:23-07:00
by webbie
First day trying to use ImageMagick and I'm running into the issue of just about all documentation being for IM6.

I am trying to create a collage by stacking images (with different sizes, rotations, etc so append doesn't work for this). Ideally this images would be jpg as I plan to use camera output but I guess they could also be converted... I mean magicked.

I've tried working off examples on this page as well as going through documentation but I'm ready for some help.

Images are just standard images that came with the install.

My code is below

Code: Select all

@ECHO OFF

SET SOURCE_PATH=C:\Program Files\ImageMagick-7.0.1-Q16\images\

rem append works as expected with one stacked above the other
magick "%SOURCE_PATH%objects.JPG" "%SOURCE_PATH%rose.jpg" -append append.jpg

rem ends with objects.jpg scaled to 200 pixels wide
magick -size +1000+1000 ^
	"%SOURCE_PATH%objects.JPG" -geometry +750+750 -resize 100x100 -composite ^
	"%SOURCE_PATH%rose.jpg" -geometry +250+250 -resize 200x200 -composite ^
	append2.jpg

rem ends with a blank white canvas max dimensions 200 pixels
magick -size +1000+1000^
	"%SOURCE_PATH%objects.JPG" -page +750+750 -resize 1000x1000 ^
	"%SOURCE_PATH%rose.jpg" -page +250+250 -resize 200x200 ^
	-layers flatten append3.jpg
ImageMagick 7.0.1-9 Q16 x64 2016-06-03
Windows 10
csh file

Extra info:
-The plan is running a photo booth for my sisters wedding. Using something like digicamcontrol + imageMagick I hope to be able to automate the shooting of a number of pics. Adding them over a nice background and (hopefully) printing them or emailing them. Obviously this question is just about creating the photo collage with imageMagick.

-For those that don't speak windows ^ is equivalent \ (took me a while to figure out) and rem comments the line.

Thanks.

Re: ImageMagick v7 image stacking

Posted: 2016-06-04T01:18:03-07:00
by Bonzo
You would probably be best using layers; check out this page: http://www.imagemagick.org/Usage/layers/#layer_shadow The examples page are probably made V6 as are mine but should still work in V7. It should work still work with convert otherwise change it to magick.

If you do not want the frames leave that part out.

These were made from the layer method:

Image
Image

Re: ImageMagick v7 image stacking

Posted: 2016-06-04T06:43:28-07:00
by snibgo
webbie wrote:-size +1000+1000
The proper syntax for "-size" is with a "x" between the numbers, and no signs.

Code: Select all

-size 1000x1000
Most v6 document examples work fine in v7, either with "magick" or "magick convert".

Re: ImageMagick v7 image stacking

Posted: 2016-06-04T08:52:29-07:00
by webbie
Thanks guys,

I'll have another play tonight and get back to you. Thanks for the input

Re: ImageMagick v7 image stacking

Posted: 2016-06-04T22:04:41-07:00
by webbie
Many thanks for the link, and the syntax correction. The layers seems to do the trick, now I just need to wrap my head around the cloning and such to get it doing exactly what I want.