composite - not working right :/

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
ultranerds
Posts: 41
Joined: 2009-02-12T02:05:15-07:00

composite - not working right :/

Post 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
haibara
Posts: 10
Joined: 2008-05-06T02:30:15-07:00

Re: composite - not working right :/

Post by haibara »

composite [overlay] [background] [result]

you lost [result] and [overlay] [background] position is wrong
ultranerds
Posts: 41
Joined: 2009-02-12T02:05:15-07:00

Re: composite - not working right :/

Post by ultranerds »

Thank you thank you thank you! Worked a charm :)

Cheers

Andy
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: composite - not working right :/

Post 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/
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
ultranerds
Posts: 41
Joined: 2009-02-12T02:05:15-07:00

Re: composite - not working right :/

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