Hmmm, im writing too much today, but im in a strike... time ago i thought in a trick to generate an accurate color palette that could be applyed to all the frames of an animation
I guess it can be used together with the pngquant command line argument "--map" i explained before
The idea is... if the source images are already indexed you need to convert them to RGB (in other words, remove the indexed palette)
We dont want to deal with that palettes because are an annoyance, the best thing we can do with them is to delete them
After that we need to generate a good color palette for all the frames... there are many image editors that can do that... but the real problem is that palette needs to be generated at a point where all the frames are visibles in the program
Lets say... if a frame is 20x20 pixels and you need to create a palette for 20 frames then you need to display the 20 frames together
If you open one of the images in photoshop/gimp, and start dropping other frames in it... the canvas size is going to be always 20x20 (because the newest layers covers the old layers), and when you generate the palette is going to contain only the colors of the pixels at the top layer (im striking this text to dont confuse you... is just an example of something that doesnt works... dont do it this way)
The correct way to do it with an image editor program... following the example of an animation composed by 20 frames of 20x20 pixels each... what we need to do is start creating an empty image of 400x20 pixels, and paste the frames in it next to each others... like in a old film tape
The goal is... we need the 100% of the pixels of all the frames visibles together in the same layer, and without overlappings
And at that point is when you can convert the image to "indexed colors" (with 256 colors), and save it as mapfile.png
After that you can use the command
Code:
C:\pngquant.exe --map "mapfile.png" "frame_1.png" "frame_2.png" "frame_3.png" "frame_4.png" (...and so on up to the 20 frames of the animation)