I wrote a script to add watermark to images on my site. Everything works ok for png/jpg, but gif images must be treaten by more complicated way. My script:
convert -splice x36 -gravity south -background white image.gif \
-coalesce -gravity SouthEast -geometry +0+0 -background white \
null: watermark-text.png -layers composite new-image.gif
For 95 percent of gif it works fine. But there are some examples, that brings errors. Concern this image:
Normal cat. Only first frame contains background (viewed layers in gimp).
This is not normal cat. Any suggestions?
The problem is that your -splice
is being applied relative to the gif's frames' layout rather than the complete image's layout. Do the -coalesce
first (order matters):
convert -coalesce -splice x36 -gravity south -background white image.gif \
-gravity SouthEast -geometry +0+0 -background white \
null: watermark-text.png -layers composite new-image.gif
See "Simple Modifications of Animations" from the Examples of ImageMagick Usage for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With