Page 1 of 1

composite - not working right :/

Posted: 2009-02-12T02:08:35-07:00
by ultranerds
Hi,

I've got a problem with something I'm trying to do.

Basically - I have 2 images -

/var/home/domain/domain.pro/www/static_lite/background.gif (400x300, with gray background)

..and then the image I wanna overlay (in the middle of the above image);

/var/home/domain/domain.pro/www/static_lite/lite_images/3/preview-93-GForum_logo.gif - a normal gif, that is only 100x50

The command I'm using is:

Code: Select all

composite -gravity center /var/home/domain/domain.pro/www/static_lite/background.gif /var/home/domain/domain.pro/www/static_lite/lite_images/3/preview-93-GForum_logo.gif
Any suggestions are much appreciated - as this is driving me nuts :(

TIA

Andy

Re: composite - not working right :/

Posted: 2009-02-12T02:28:57-07:00
by haibara
composite [overlay] [background] [result]

you lost [result] and [overlay] [background] position is wrong

Re: composite - not working right :/

Posted: 2009-02-12T03:01:59-07:00
by ultranerds
Thank you thank you thank you! Worked a charm :)

Cheers

Andy

Re: composite - not working right :/

Posted: 2009-02-12T17:03:04-07:00
by anthony
Be warned however that in "convert" it is

convert [background] [overlay] -composite [result]

as this is easier for logical processing of the the images.

The "composite" order is the way you say things..

composite [overlay] OVER [destination] PRODUCING [result]

the default composition operator being 'Over'.

See IM examples, Alpha composition
http://www.imagemagick.org/Usage/compose/

Re: composite - not working right :/

Posted: 2009-02-13T00:47:59-07:00
by ultranerds
Hi,

Thanks for the reply. Although we also use convert, in this case - we're making 4 different images (and only one of them needs the `composte` bit - so should be ok doing it the way we currently are :))

Cheers

Andy