Bitmaps in FreeImage are always loaded in their default bit depth. If you want the bitmap to be stored in another bit depth, the library provides several conversion functions.
FIBITMAP *FreeImage_ConvertTo8Bits(FIBITMAP *dib);
Converts the given bitmap to 8 bits. If the bitmap is 24 or 32-bit RGB, the colour values are converted to greyscale.
FIBITMAP *FreeImage_ConvertTo16Bits555(FIBITMAP *dib);
Converts the given bitmap to 16 bits. The resulting bitmap has a layout of 5 bits red, 5 bits green, 5 bits red and 1 unused bit.
FIBITMAP *FreeImage_ConvertTo16Bits565(FIBITMAP *dib);
Converts the given bitmap to 16 bits. The resulting bitmap has a layout of 5 bits red, 6 bits green and 5 bits red.
FIBITMAP *FreeImage_ConvertTo24Bits(FIBITMAP *dib);
Converts the given bitmap to 24 bits.
FIBITMAP *FreeImage_ConvertTo32Bits(FIBITMAP *dib);
Converts the given bitmap to 32 bits.
FIBITMAP *FreeImage_ColorQuantize(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize);
Quantizes a full colour 24-bit bitmap to a palletised 8-bit bitmap. The quantize parameter specifies which colour reduction algorithm should be used.
| Parameter | Description | ||||
| FIQ_WUQUANT | Wu's color quantization algorithm | ||||
| FIQ_NNQUANT | NeuQuant quantization algorithm |