Animated GIF damage

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
cmapuk_0nline

Animated GIF damage

Post 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 =)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Animated GIF damage

Post by magick »

Try this command:
  • convert kids.gif -coalesce -bordercolor black -border 10x10 -deconstruct borderkids.gif
That should produce correct results for you.
cmapuk_0nline

Re: Animated GIF damage

Post 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! =)
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Animated GIF damage

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Animated GIF damage

Post by anthony »

Addundum...

Also look at the video second of IM examples. It has a good summery of color optimization of VIDEO animations.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply