Discussion:
invert colors of animated gif?
Patrick J. Collins
2008-06-22 03:41:03 UTC
Permalink
I have an animated gif image of a progress spinner which I am trying to use on
a black background, however the spinner has some white pixels around it which
makes it look pretty bad.

I am curious if imagemagick has a way to invert the colors on all frames of
a gif image? And if so, how to do it.

Thank you.

Patrick J. Collins
http://collinatorstudios.com
Fred Weinhaus
2008-06-22 04:30:57 UTC
Permalink
I am not an expert on animations, but ...

You will likely have to separate the frames (using coalesce), negate
them (using -negate) or change the color of only the white ones
(using -fuzz xx% -fill somecolor -opaque white), etc and then
recombine. But should not be too bad.

See
http://www.imagemagick.org/Usage/anim_basics/
http://www.imagemagick.org/Usage/anim_mods/
http://www.imagemagick.org/Usage/color/
http://www.imagemagick.org/Usage/
http://www.imagemagick.org/Usage/reference.html


if this does not work

convert animation.gif -negate animation_negate.gif

then something like this should work

convert animation.gif -coalesce -negate \
-quiet -layers OptimizePlus -loop 0 animation_negate.gif
Post by Patrick J. Collins
I have an animated gif image of a progress spinner which I am trying to use on
a black background, however the spinner has some white pixels around it which
makes it look pretty bad.
I am curious if imagemagick has a way to invert the colors on all frames of
a gif image? And if so, how to do it.
Thank you.
Patrick J. Collins
http://collinatorstudios.com
Patrick J. Collins
2008-06-22 05:57:15 UTC
Permalink
Thank you so much.. your 2nd suggestion worked perfectly! ImageMagick is
really amazing!!

Patrick J. Collins
http://collinatorstudios.com
Post by Fred Weinhaus
I am not an expert on animations, but ...
You will likely have to separate the frames (using coalesce), negate
them (using -negate) or change the color of only the white ones
(using -fuzz xx% -fill somecolor -opaque white), etc and then
recombine. But should not be too bad.
See
http://www.imagemagick.org/Usage/anim_basics/
http://www.imagemagick.org/Usage/anim_mods/
http://www.imagemagick.org/Usage/color/
http://www.imagemagick.org/Usage/
http://www.imagemagick.org/Usage/reference.html
if this does not work
convert animation.gif -negate animation_negate.gif
then something like this should work
convert animation.gif -coalesce -negate \
-quiet -layers OptimizePlus -loop 0 animation_negate.gif
Post by Patrick J. Collins
I have an animated gif image of a progress spinner which I am trying to use on
a black background, however the spinner has some white pixels around it which
makes it look pretty bad.
I am curious if imagemagick has a way to invert the colors on all frames of
a gif image? And if so, how to do it.
Thank you.
Patrick J. Collins
http://collinatorstudios.com
_______________________________________________
Magick-users mailing list
http://studio.imagemagick.org/mailman/listinfo/magick-users
.
Continue reading on narkive:
Loading...