gray scale gradients are too abrupt


The algorithm is too abrupt on gray scale gradients. Is there any way to adjust the quality of the compression like you can with jpeg?

Original image:
Original Image

nQaunt result:
nQaunt result

file attachments


JoeyBradshaw wrote Aug 29, 2013 at 2:08 AM

Sadly it appears that nQuant has issues with almost all grayscale images. Here's another issue where the gray shadow is unacceptable.

cloud original:
cloud original

nquant result cloud:
nquant result cloud

mwrock wrote Aug 31, 2013 at 6:01 AM

If you use the fader parameter, the results will be better:

AlphaFader of 1 is the highest quality and is probably the best for grey scale images:


Note that this produces an image that is ~30% larger than the original because nquant is purely a quantizer and does not apply any lossless optimization algorithm to the quantized image. After using optipng.exe to apply optimization to the compression, it yields an image 30% SMALLER than the original:


The original was already optimized so applying just optipng to the original would not produce any gains.

Use the /f parameter to apply the fader to the nquant exe or if you are using the .net apim use the alphaFader argument.

Let me know if you have questions.


mwrock wrote Aug 31, 2013 at 6:08 AM

I should comment that the first image you commented on does not fare nearly as well and looks pretty bad after quantization even with the fader set to 1.

rpresser wrote Feb 11, 2014 at 8:15 PM

It's not just true grayscale images. Look at this image, which is 24 bit color, but has a low intensity gray gradient. It has noticeable banding when Wu quantizes it, even with fader 1.

rpresser wrote Feb 11, 2014 at 8:19 PM

sorry .. here's the image


And here's how it quantizes