Pseudo-Gray from 16-bit grey gives less colors than expected


gmic_qt and Black & White filter with Pseudo-Gray dithering set to 5 and other parameters set to default values gives me from 16-bit grey image less than 256 colors.

As i just started to tinker with G’MIC, then i probably do something wrong. Could you please point me in the right direction. command-line example for pseudogray conversion would also be nice.

(G'MIC staff) #2

From the command line:

$ gmic imageB&W_8bits.png luminance to_pseudogray 5


$ gmic imageB&W_16bits.png div 257 luminance to_pseudogray 5

This may result in less than 255 colors used, if your image does not use all the grey shades available.
For instance, with the image lena:

$ gmic sample lena luminance +to_pseudogray 5 round colormap 0

says that the rounded luminance image (so the B&W one) has 137 colors, while the pseudogray-dithered has 247, which is a bit better but still less than 255.


Thanks for your reply and examples. Suggested command line example works as expected, but i have still no luck with gmic_qt GUI.

I think that problem is not in missing grey shades in initial image. I tested it with file DeltaE_16bit_gamma2.2.tif from RGB Reference Images. 16-bit grey image from this file has 56860 grey shades. From command line with your 2nd example i get 6622 pseudogray-dithered colors but from gmic_qt Black & White filter with default parameters and Pseudo-Gray dithering set to 5 i get only 250 colors. Maybe i have missed some important parameter?