Page 1 of 1

[SOLVED] How to add animated watermark (GIF) on a static image (GIF)?

Posted: 2015-11-15T00:27:04-07:00
by pigeon33
Hello,

I will try to keep it short ))

My goal is to find a command line to add an animated watermak (GIF) on a static image (GIF)

My version of ImageMagick:

convert -version
Version: ImageMagick 6.9.2-5 Q16 x64 2015-10-31 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180031101
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib

My platform is Windows.

The command line that I tried: http://www.xoogu.com/2013/how-to-automa ... agemagick/

The problem with this command line is even if you use an animated GIF as watermark the final result is not animated.

Could you please tell me what is the command line that can fit my needs?

Thank you...

M.

Re: How to add animated watermark (GIF) on a static image (GIF)?

Posted: 2015-11-15T01:06:06-07:00
by fmw42

Re: How to add animated watermark (GIF) on a static image (GIF)?

Posted: 2015-11-15T03:04:08-07:00
by pigeon33
Thank you because it is exactly what I need BUT when I copy/paste the command line in my cmd it don't works because it is (I guess) a multi line command. Is it possible to convert this command in a 1 line command only?

debug:

F:\>convert -size 100x100 plasma:fractal null: \( script_k.gif -coalesce \) \
convert.exe: unable to open image `\(': No such file or directory @ error/blob.c/OpenBlob/2701.
convert.exe: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.
convert.exe: unable to open image `\)': No such file or directory @ error/blob.c/OpenBlob/2701.
convert.exe: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.

F:\> -gravity Center -layers Composite \
'-gravity' is not recognized as an internal or external command,
operable program or batch file.

F:\> -layers Optimize composite_background.gif

Re: How to add animated watermark (GIF) on a static image (GIF)?

Posted: 2015-11-15T03:12:43-07:00
by snibgo
Examples on those pages are Unix bash. Bash syntax is different to Windows syntax. See http://www.imagemagick.org/Usage/windows/

Re: How to add animated watermark (GIF) on a static image (GIF)?

Posted: 2015-11-15T08:08:25-07:00
by pigeon33
Thank you because now it works on my Windows however why I always see the "plasma:fractal" image? My goal is to be able to add the "script_k.gif" (animated GIF) to any kind of GIF not only to "plasma:fractal". Could you please tell me what I have to modify?

Re: How to add animated watermark (GIF) on a static image (GIF)?

Posted: 2015-11-15T08:28:08-07:00
by snibgo
Instead of "plasma:fractal", put the filename of the image you want.

Re: How to add animated watermark (GIF) on a static image (GIF)?

Posted: 2015-11-15T08:46:19-07:00
by pigeon33
Thank you Snibgo it works perfectly!

In case someone else need it... This is the command line I use on Windows:

convert -size 100x100 "F:\composite_background.gif" null: ( "F:\script_k.gif" -coalesce ) ^
-gravity Center -layers Composite ^
-layers Optimize "F:\test.gif"

Re: [SOLVED] How to add animated watermark (GIF) on a static image (GIF)?

Posted: 2015-11-15T09:00:26-07:00
by pigeon33
Last quick question... for the watermark I use a GIF with transparent background but when I apply this watermark on my image the background is still transparent but it is not very clean... do you know why? Thank you!

Re: [SOLVED] How to add animated watermark (GIF) on a static image (GIF)?

Posted: 2015-11-15T09:08:37-07:00
by snibgo
pigeon33 wrote:... do you know why?
Not without seeing the images. Don't forget that GIF is limited to 256 colours. If both the inputs have 256 colours each, then many pixels will change colour.

Re: [SOLVED] How to add animated watermark (GIF) on a static image (GIF)?

Posted: 2015-11-15T12:11:52-07:00
by fmw42
GIF transparency is also binary (on or off) as opposed to 8-bit transparency in formats such as PNG8:. So the edges may be jagged.

Snibgo also pointed out about the color limitation. So it might be a good idea to remap each frame to a common color map. See http://www.imagemagick.org/Usage/quantize/#remap