ImageMagick v7 image stacking

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
webbie
Posts: 3
Joined: 2016-06-03T20:28:57-07:00
Authentication code: 1151

ImageMagick v7 image stacking

Post 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.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: ImageMagick v7 image stacking

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: ImageMagick v7 image stacking

Post 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".
snibgo's IM pages: im.snibgo.com
webbie
Posts: 3
Joined: 2016-06-03T20:28:57-07:00
Authentication code: 1151

Re: ImageMagick v7 image stacking

Post by webbie »

Thanks guys,

I'll have another play tonight and get back to you. Thanks for the input
webbie
Posts: 3
Joined: 2016-06-03T20:28:57-07:00
Authentication code: 1151

Re: ImageMagick v7 image stacking

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