Color Conversion

LEADTOOLS makes it possible to expand or reduce an image's color depth, from 1-bit to 32-bit, with multiple dithering methods using various palette options. Programmers can choose from 8 different dithering methods including Floyd Stein, Burkes, Ordered dithering, Color reduction, Stucki, Stephens, Sierra and Jarvis. Flexible palette options include LEAD's fixed palette, an auto-optimized palette, or a user defined palette. Images can be separated and/or reconstructed to/from individual RGB, CMYK, CMY, HSV, YUV and HSL color planes. When working with 12 and 16 bit grayscale images, LEADTOOLS' window leveling allows you to select the desired range of bits to be used for display or processing. (available in the LEADTOOLS Medical Imaging) All of these options give you the flexibility to make your images look just right for your application, whether you are working with medical images, scanned documents or digital photographs.

Images that are less than 16 bits per pixel require a palette, which is an array of color values. The value of each pixel in one of these images is an index into the palette. (Images that are 16 bits per pixel or higher store the color values directly in the image, as pixel values.)

The number of colors in a palette is limited to the highest possible index value. For example, if an image is 8 bits per pixel, it can have a palette of 256 colors, which is the number of different colors that can be referenced by using the pixel values as 8-bit indexes.

If an image file is less than 16 bits per pixel, the file contains a palette, and when you load the image into a bitmap, the palette is also loaded into the bitmap handle.

Whenever you reduce a bitmap to less than 16 bits per pixel, a palette must be specified or created. You can do any of the following: