Hey guys I'm trying to separate a colored animated gif into different color files (each color in a gif should become a new gif only with that color and the rest would be transparent) so i could later bitmap each of those files to give it a bit more sharpness and maybe reduce the size. Could someone advice on how could i do that?
I've tried Fred's kmeans script but to no awail, as i only get the color values
Working environment:
IM version:
Version: ImageMagick 7.0.8-26 Q16 x86_64 2019-02-09 https://imagemagick.org
OS:
Mac OS 10.12.6 (Sierra)
Thanks in advance!
Separating each color in an animated gif into separate gifs
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Separating each color in an animated gif into separate gifs
You will have to extract each frame one at a time, then for each color make all the other colors transparent using +transparent somecolor and write that to a new image. That means for each frame you will get up to 256 new images. Is that what you want? To do that, you will have to write a script loop over each of the 11 frames (after coalescing) and over each color in that frame. That will be quite a few images. You can get the list of colors using -unique-colors.
See
https://imagemagick.org/script/command- ... ransparent
https://imagemagick.org/Usage/quantize/#extract
You can reduce the size of the animation, by applying one single color map to all frames. See -remap at
https://imagemagick.org/Usage/quantize/#remap
use -dither none
See
https://imagemagick.org/script/command- ... ransparent
https://imagemagick.org/Usage/quantize/#extract
You can reduce the size of the animation, by applying one single color map to all frames. See -remap at
https://imagemagick.org/Usage/quantize/#remap
use -dither none