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:
Let LEADTOOLS create a palette that is optimized for the particular image. (As an option, this palette can include the system identity palette.)
Specify a fixed palette, which is the same for all images that use it. The palette can be LEAD's fixed palette or the Netscape fixed palette.
Specify a palette of any size that you have created. In creating your own palette, you can let LEADTOOLS do part of the work. For example, you can fill in part of the palette, and let LEADTOOLS fill the rest with optimized colors.
Modify the colors in the bitmap palette.
Copy a palette from a device context.
[DLL only] Use a table to increase the efficiency of the palette that you define.
[Medical Imaging only] Use window leveling to map grayscale intensities by specifying the bit range and/or a user defined color map.