create common palette
Posted: 2007-03-07T13:33:11-07:00
I'd like to create a common color palette from a bunch of GIF images. (To be clearer, this palette will not be applied to these images, only derived from them). The color palette should be based on frequency only.
In other words, algorithm is to count each occurrence of a color in each of the images. Then create a palette based on the 256 colors that appear most frequently.
Is something like this possible with ImageMagick? I've got this far:
However, I don't know exactly what that command is doing. In particular, I don't think it is following a simplistic algorithm like I outlined above, but rather doing some dithering or something.
Any help would be greatly appreciated.
In other words, algorithm is to count each occurrence of a color in each of the images. Then create a palette based on the 256 colors that appear most frequently.
Is something like this possible with ImageMagick? I've got this far:
Code: Select all
convert *.gif +append -colors 256 -unique-colors palette.gif
Any help would be greatly appreciated.