Page 1 of 1

Animated GIF damage

Posted: 2007-06-05T05:47:14-07:00
by cmapuk_0nline
Hello!
i try to add border to animated gif and ....
Source image
http://picozilla.com/en/116712/kids.gif.html

Code: Select all

c:\temp\animated>convert kids.gif -bordercolor black -border 10x10 borderkids.gif
Result :shock: :shock: :shock:
http://picozilla.com/en/116713/borderkids.gif.html

Code: Select all

c:\temp\animated>convert -version
Version: ImageMagick 6.3.4 05/04/07 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2007 ImageMagick Studio LLC
How to modify animated gif without damaging?

Thanx =)

Re: Animated GIF damage

Posted: 2007-06-05T12:49:03-07:00
by magick
Try this command:
  • convert kids.gif -coalesce -bordercolor black -border 10x10 -deconstruct borderkids.gif
That should produce correct results for you.

Re: Animated GIF damage

Posted: 2007-06-05T13:30:55-07:00
by cmapuk_0nline
magick wrote:Try this command:
  • convert kids.gif -coalesce -bordercolor black -border 10x10 -deconstruct borderkids.gif
That should produce correct results for you.
It works!
Thanxvm! =)

Re: Animated GIF damage

Posted: 2007-06-05T18:51:27-07:00
by anthony
Using a Coalesce/Modify/Optimize sequence as shown above is the typical way of modifying a GIF animation. See modify a coalesced animation. Especially with a general purpose (but still not finalised) GIF Optimizer option "-layers optimize"

DO NOT USE Deconstruct It is NOT designed to optimize ALL animations. It will do basic frame optimize for simple overlay animations like yours, but it will fail if the animation also clears pixels to transparency. Use the -layers optimize in the later IM releases (after v6.2.6-2) whcih was designed for general GIF optimization (and still improving).

The -coalesce removes the Compression Optimization (either transprancy optimization or LWZ optimization) that you are seeing. Turning the animation into a simple Coalesced Animation IM however will not restore a LWZ optimization, though it can do the simplier (and usally good enough) transprancy optimization

However if the animation has no Frame Optimization (and it doesn't look like it does) you can try to add a border using -compose Copy which tell the -border. For more details see Border, adding space around the image.

If you had followed some of the numerious links above, you probably would have guessed that IM Examples has a very large set of examples on GIF animations, and all its complexities. It may be a good thing to read.

Comments, Suggestions and Additions always welcome.

Re: Animated GIF damage

Posted: 2007-06-05T18:58:05-07:00
by anthony
Addundum...

Also look at the video second of IM examples. It has a good summery of color optimization of VIDEO animations.