Cannot apply watermark to GIF

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
smantscheff
Posts: 7
Joined: 2010-10-19T03:07:36-07:00
Authentication code: 8675308

Cannot apply watermark to GIF

Post by smantscheff »

I'm trying to add a watermark stamp to a gif image. I have a script which works fine for JPGs:

Code: Select all

composite -gravity south -geometry +0+10 stamp.png  %1 %2
But when applied to GIF files they result in a grey only bitmap. I tried to convert stamp.png to stamp.gif first, but to no avail.

Input looks like that:
Image:
Image
Stamp:
Image

IM runtime is ImageMagick 6.7.1-0 2011-07-06 Q16 (Windows 7) and ImageMagick 6.5.7-8 2010-12-02 Q16 (Ubuntu). Result is the same on both: Image

How can I apply this watermark to the image?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Cannot apply watermark to GIF

Post by fmw42 »

jpg does not support transparency. you would likely need to flatten your transparent image with some background color first. Or save your output as png or gif or tif
smantscheff
Posts: 7
Joined: 2010-10-19T03:07:36-07:00
Authentication code: 8675308

Re: Cannot apply watermark to GIF

Post by smantscheff »

Or save your output as png or gif or tif.
This is what I am trying. Input is GIF and PNG, output is GIF. But the merging of the two yields bad results.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Cannot apply watermark to GIF

Post by fmw42 »

try this, it works for me. note your large image has two frames and a virtual canvas. use +repage to remove the virtual canvas and use just the first frame.

convert zahnarzt1.gif[0] stamp.png +repage -gravity south -geometry +0+10 -compose over -composite result.gif
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Cannot apply watermark to GIF

Post by anthony »

Also see Animation Modifications
http://www.imagemagick.org/Usage/anim_mods/#annotating
And Image Annotation, Watermarking
http://www.imagemagick.org/Usage/annota ... termarking

Fred however is right you have two frames with slight differences in 'dithering', Especially in E-Dither 'speckle' on the Ken Doll's pants. But no real animated differences between the two frames.

For more help more detail of what you want to achieve is needed.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
smantscheff
Posts: 7
Joined: 2010-10-19T03:07:36-07:00
Authentication code: 8675308

Re: Cannot apply watermark to GIF

Post by smantscheff »

Thanks for your help, it worked.
Someday I will be grown up and understand all this - or at least some of it.
Post Reply