Page 1 of 1

Making color transparent on animated gifs

Posted: 2016-10-16T14:56:21-07:00
by PaulLee
Hi,
This is my first post, please be kind :-)

I have a couple of animated gifs that I downloaded and I'd like to make a specific color (black) transparent in each of the layers of the gifs. Is there a simply way to do it via the command line?

Best wishes

Paul

Re: Making color transparent on animated gifs

Posted: 2016-10-16T15:01:39-07:00
by fmw42

Code: Select all

convert image.gif -coalesce -transparent black -layers optimize result.gif
If the color is not perfectly black, then you can add -fuzz XX% to consider near-black as if it were black.

Code: Select all

convert image.gif -coalesce -fuzz 5% -transparent black -layers optimize result.gif
See
http://www.imagemagick.org/Usage/anim_basics/
http://www.imagemagick.org/Usage/anim_opt/
http://www.imagemagick.org/Usage/anim_mods/


Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.

See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at viewtopic.php?f=1&t=9620

For novices, see

viewtopic.php?f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/