Page 1 of 1

reduce color and dithering

Posted: 2011-08-24T06:44:40-07:00
by webshaker
Hi.

I'd like to reduce a png to a RGB565 bitmap.
I do not find how to do that so, I decided to reduce it with a -color parameter to RGB555

convert src.png -depth 5 dst.png

But the quality was not very good, so I tried to add a Floyd dithering

convert src.png -depth 5 -dither FloydSteinberg dst.png

But it seem's taht there is not quality improvement !
Does -dither can work with -color parameter ?

Thank's
Etienne

Re: reduce color and dithering

Posted: 2011-08-24T06:53:51-07:00
by webshaker
ok sorry. I was wrong.
in fact the dithering works.

Re: reduce color and dithering

Posted: 2011-08-24T16:28:25-07:00
by anthony
See IM examples Quantization and Dithering
http://www.imagemagick.org/Usage/quantize/

for a 565 color palette try this ordered dither
"-ordered-dither o8x8,32,64,32"

However typically for a 16 bit color pallette a "TrueColor 556 Colormap" is used.

See.. TrueColor 16bit Colormap
http://www.imagemagick.org/Usage/quanti ... t_colormap
Ordered Dither using Uniform Color Levels
http://www.imagemagick.org/Usage/quantize/#od_posterize

One point -depth 5 does not do anythig in terms of dithering. It is a the desired image depth to use when writing images (or the depth of raw image file formats when reading). As such it does nothing.

What you should be doing is using either -map with a colormap image, (such as a netscape: 6x6x6 color image) or using -ordered-dither with appropriate color level specifications. Note that the former produces a 'psuedo-random' error correction dither, while that later produces a fixed dither pattern according to a 'threashold map', which can be user defined!