Page 1 of 1

How to watermark animated GIFs & combine 2 commands together

Posted: 2012-08-23T14:59:12-07:00
by tk123
I am on a Windows 7 machine using imagemagick from the command line.

The following code works to add watermarks to images:

Code: Select all

composite -watermark 30% -gravity south the_watermark.png pic_to_be_watermaked.png watermark_completed.png
Problems are:

- It doesn't work when I try to watermark an animated GIF
- How to use this watermark command in conjunction with the command below?

This command takes all the PNGs inside the folder "static_images" and combines them into an animated GIF. It also makes sure that the image is 350px in width and the height is kept to the proper aspect ratio. It also gives the image some fuzz and sets the speed of the animation to 4 and makes sure it loops infinitely:

Code: Select all

convert -resize 350x350 -fuzz 1.6% -delay 4 -loop 0 static_images/*.png -layers OptimizePlus -layers OptimizeTransparency animated_gif.gif
Questions:
---------------

1. How can I combine the watermark command with the one above?
2. How can I get the watermark commmand to work with animated GIFs?

Re: How to watermark animated GIFs & combine 2 commands toge

Posted: 2012-08-23T16:31:44-07:00
by fmw42
1. How can I combine the watermark command with the one above?
2. How can I get the watermark commmand to work with animated GIFs?
Composite is very old and not very flexible.

1) Use convert ... -compose modulate rather than composite -watermark. see http://www.imagemagick.org/Usage/compose/#watermark

2) See animation examples at http://www.imagemagick.org/Usage/compose/#watermark. You probably have to -coalesce the animation and then composite the watermark onto all the frames using convert ... -compose modulate -composite, then write them all again to a gif format.

Re: How to watermark animated GIFs & combine 2 commands toge

Posted: 2012-08-23T18:24:47-07:00
by anthony
See Animation Modiciations, Layer Composition
http://www.imagemagick.org/Usage/anim_mods/#composite

If one of the two lists is a single image, it is composed against the whole list of the other images.
See Single image compostion
http://www.imagemagick.org/Usage/anim_m ... ite_single

Use it with the normal single frame compostion tecniques, Watermarking with Images
http://www.imagemagick.org/Usage/annota ... mark_image