Page 1 of 1

Color quantization problems

Posted: Tue Mar 30, 2010 4:15 am
by foxyshadis
This is half bug report/half enhancement request. From an old thread:
xnview wrote:
Bingo wrote:
xnview wrote:But with the -dither, all is ok, no?
Yes, but the output is... dithered !
I do not want dithering in the output images, I need plain colors.
Yes, right. There is a problem because when i quantize picture, i reduce bits per component, so after white is no more white :-(
You can try with other software, you'll have same result.
But do you have same result with ImageMagick?
Five years later, this problem remains. Photoshop/Imageready has had excellent adaptive color quantization for over a decade now, but XnView's still can't keep white backgrounds white. Because of this I keep having to use photoshop to export my pngs even though I do all basic edits in xnview now. Any chance for this to be looked at again and a smarter algorithm used?

1. For simple quantize, I would say anything below 128 should be quantized down and anything above should be quantized up. eg, 8-level quantization is 0, 32, 64, 96, 159, 191, 223, 255
2. Dither should mean something more useful, like a median-cut algorithm.
3. A new Perceptual mode with K-means or the algorithm described in this paper.
4. Pattern dithering also needs to be fixed: Greyscale images turn all kinds of funky colors when you use it.
5. Floyd/Steinburg works great, though.

Irfanview, surprisingly, also still has the same problem years after I first reported it.
[edit: changed the link to median cut to the C++ implementation.]

Re: Color quantization problems

Posted: Sun Apr 25, 2010 12:30 pm
by XnTriq