Page 2 of 2

Re: Overlaying a picture on a collage/montage (with mogrify)

Posted: 2010-03-10T09:19:09-07:00
by fmw42
Use -background to set the background color in montage and then use -bordercolor to do the extra border needed to make the outside border the same as the inside borders.

montage -background black zelda3b.jpg zelda3b.jpg zelda3b.jpg \
zelda3b.jpg zelda3b.jpg zelda3b.jpg \
zelda3b.jpg zelda3b.jpg zelda3b.jpg \
-tile 3x3 -geometry +7+7 miff:- | \
convert - -bordercolor black -border 7 zelda_montage2.jpg

The pipe

miff:- | convert - -bordercolor black -border 7

is needed as you cannot mix convert commands within a montage. So you pipe the output from montage (miff:- | ) to convert - and then add the extra border around the outside to make the outside border the same as all the rest.

Re: Overlaying a picture on a collage/montage (with mogrify)

Posted: 2010-03-18T23:06:55-07:00
by ShekarKCB
Hi,

This works Great... I modified little and i can get what i want. A collage from 9 images.
Image

Code used was

Code: Select all

echo -e "useing 'montage to convert the images...'"
 montage image-0.jpg image-1.jpg image-2.jpg image-3.jpg image-4.jpg image-5.jpg image-6.jpg image-7.jpg image-8.jpg -tile 3x3 -geometry +7+7 -background white miff:- |  convert - -bordercolor white -border 7 output_montage.jpg;

OP=`identify output_montage.jpg | awk '{print $3}'`;
echo -e "output_montage.jpg is Created with |$OP| size....Resizing image to 315x320..\n";
convert output_montage.jpg -resize 315x320 -quality 100 output_montage_1.jpg;
OP=`identify output_montage_1.jpg | awk '{print $3}'`;
echo -e "output_montage_1.jpg is Created with |$OP| size....adding border 0x40 in order to make 315x320..\n";
convert output_montage_1.jpg -bordercolor black -border 0x40 -quality 100 output_montage_2.jpg;
Thanks for the help. Is there any way to tilt the image to the behind or right side using convert/mogrify/montage?
From photoshop i created this image is there any to do the same using convert/mogrify?
Image

Thanks

Re: Overlaying a picture on a collage/montage (with mogrify)

Posted: 2010-03-19T01:01:10-07:00
by Bonzo
I have an example of most of the operators here: http://www.rubblewebs.co.uk/imagemagick/operator.php
They are written using php but you should be able to convert it to how you are running your code.

You want to use distort and depending on your version the use changed for the specification of the corners.
Image

Code: Select all

<?php 
$cmd = "$input -matte -virtual-pixel transparent ".
"-distort Perspective \"0,0 0,0  0,200 0,200 266,200 ".
"266,180 266,0 266,20 \" ";
exec("convert $cmd virtual_pixel.png"); 
?> 

Re: Overlaying a picture on a collage/montage (with mogrify)

Posted: 2010-03-19T03:45:46-07:00
by ShekarKCB
Hi,

I got the example. But could you tell me what are those numbers used? is it a,b,c,d sides? or how does it represented?
Basically what those numbers say ? (0,0 0,200, ...etc)

Thanks

Re: Overlaying a picture on a collage/montage (with mogrify)

Posted: 2010-03-19T04:10:47-07:00
by Bonzo
Check out Anthony's examples: http://www.imagemagick.org/Usage/distorts/#perspective

From memory it was "top left old" "top left new" "bottom left old" "bottom left new" etc. and it is now "top left old" "bottom left old" "bottom right old" "top right old" "top left new" "bottom left new" etc.

Depending on your version; I can not remember when it changed possibly around 6.3.5 ? If one method does not work try the other.

Re: Overlaying a picture on a collage/montage (with mogrify)

Posted: 2010-03-19T11:56:22-07:00
by fmw42
I think it changed at 6.3.6.0

Re: Overlaying a picture on a collage/montage (with mogrify)

Posted: 2010-03-21T21:49:42-07:00
by ShekarKCB
Hi,

Issue resolved. Used gimp to find the required co-ordinates. Great help Thanks Once again.

Thanks