Reducing bit resolution

Q:  How can I reduce the bit resolution of an image?

A:  To reduce the bit resolution of an image, use the dithering functions. Dithering functions are proposed to reduce the bit resolutions of an image with the least quality loss. There are two types of dithering implemented in BIIMAGE.Dll, error diffusion and ordered dithering. Error diffusion dithering functions can produce 8, 4 and 1 bit per pixel images, ordered ditherings always produce 1 bit per pixel images. For further images see the descriptions of the ditherings above in chapter Dithering Functions.

 

Code example:

       #include “BiImage.h”

       HANDLE hSourceDib = NULL;

       //       Load the input image

       …

       HDIB DitheredDIB = DitherFS4(hSourceDIB, 1);

       //       Further processing