Closed dragon66 closed 8 years ago
Added Xiaolin Wu's color quantization algorithm (see Graphics Gems vol. II, pp. 126-133) and NeuQuant - neural network algorithm. The resulting image quality is excellent even without dither. The only thing left is to figure out a way to automatically deal with transparent color.
The following are the images before and after quantization:
[Original]
[Quantized - Wu's algorithm]
[Quantized+dither]
[NeuQuant - neural network algorithm]
Added code to automatically deal with transparency.
Currently, the only quantization algorithm used is "popularity". It's quick and produces good result if combined with dither process. But sometimes, when better image quality is required, we need a better algorithm. We may not even need a dither process in this case.