reduce color and dithering

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
webshaker
Posts: 16
Joined: 2007-07-25T15:42:25-07:00

reduce color and dithering

Post 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
webshaker
Posts: 16
Joined: 2007-07-25T15:42:25-07:00

Re: reduce color and dithering

Post by webshaker »

ok sorry. I was wrong.
in fact the dithering works.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: reduce color and dithering

Post 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!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply