Colour Depth Control

Change the colour depth of a bitmap using various optimisations and save to a smaller bitmap file.

Colour Depth Reduction Sample

In VB, you cannot change the colour depth of a bitmap. This article presents classes allowing you to reduce or increase the colour depth using a number of different methods and also to save the resulting image to disk as a bitmap with the specified colour depth.

About the Sample

This article brings together all of the colour reduction techniques presented in the other articles in the vbMedia section and provides a sample application to exercise the methods.

For more information on reducing colours, check:

The sample itself uses a True Colour DIBSection as a basis for the processing, and then adds the following additional classes:

  1. cPalette
    Enables management and creation of palettes of colours.
  2. cColourReduceDIB
    Allows you to apply a palette, create a Black and White image or to GrayScale an DIBSection.
  3. cDibSectionSave
    Provides methods for saving a true colour DIBSection to any of the standard Bitmap colour depths using native calls.