Smart filter to remove Floyd-Steinberg dithering from paletted images.
The tool analyses image palette to find optimal blurring threshold. For any two adjacent pixels, if the palette has a color that is between colors of these two pixels, then it's assumed to be an edge.
The algorithm should be useful when converting PNG8 to JPEG or anim-GIF to video (although at the moment the tool only reads PNG).
make
./undither input.png output.png
The input must be an 8-bit PNG image.