Page 1 of 1

overlapping photos in single command

Posted: 2009-02-19T18:44:04-07:00
by telarson
I'm trying to take a set of images, resize and crop the images and combine them together in a collage. I can do this in several convert commands like

#1. resize and crop commands - made up but you get the idea
convert a.jpg -resize 250x350 -gravity center -crop 50x50+50+45 +repage a1.jpg
convert b.jpg -resize 100x350 -gravity center -crop 50x50+50+45 +repage b1.jpg
...

#2. combine command
convert -page +5+10 a1.jpg -page +50+10 b1.jpg ... -mosiac out.jpg

Is it possible to do this all in one convert command?

Also, will I get a better quality image when using -draw or -page when combining png or jpegs into a single image?

Thanks,

Tait

Re: overlapping photos in single command

Posted: 2009-02-19T18:56:25-07:00
by fmw42
telarson wrote:I'm trying to take a set of images, resize and crop the images and combine them together in a collage. I can do this in several convert commands like

#1. resize and crop commands - made up but you get the idea
convert a.jpg -resize 250x350 -gravity center -crop 50x50+50+45 +repage a1.jpg
convert b.jpg -resize 100x350 -gravity center -crop 50x50+50+45 +repage b1.jpg
...

#2. combine command
convert -page +5+10 a1.jpg -page +50+10 b1.jpg ... -mosiac out.jpg

Is it possible to do this all in one convert command?

Also, will I get a better quality image when using -draw or -page when combining png or jpegs into a single image?

Thanks,

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

(if you are on windows, see http://www.imagemagick.org/Usage/api/#windows )

try something like this (but I have not tested it):

convert -page +5+10 a1.jpg \( a.jpg -resize 250x350 -gravity center -crop 50x50+50+45 +repage \) \
-page +50+10 \( b.jpg -resize 100x350 -gravity center -crop 50x50+50+45 +repage \) -mosaic out.jpg

Re: overlapping photos in single command

Posted: 2009-02-23T21:23:39-07:00
by anthony
IF you did not use JPEG for intermediate image but used PNG or the IM insternal format MIFF instead then you would not have any quality loss.

MIFF is also useful as you can generate a pipeline of images from multiple commands to feed into a final 'merge together' command.

An example of this is in IM Examples, Layer Merging Examples
http://www.imagemagick.org/Usage/layers/#example

Re: overlapping photos in single command

Posted: 2009-02-24T03:39:36-07:00
by telarson
anthony wrote:IF you did not use JPEG for intermediate image but used PNG or the IM insternal format MIFF instead then you would not have any quality loss.

MIFF is also useful as you can generate a pipeline of images from multiple commands to feed into a final 'merge together' command.

An example of this is in IM Examples, Layer Merging Examples
http://www.imagemagick.org/Usage/layers/#example

Thank you, Anthony! That was great additional advice.

-Tait