#1 in a very long list – ApplyPaletteCommand
Greetings, Campers. A long time ago, in a galaxy far, far away, some very smart people decided to make things easy. They developed a bunch of ImageCommands, which, though they did some pretty nifty things to images, were stab-your-eyes-out difficult to find in the documentation. So, I’m introducing a new series – the DotImage ImageCommands.
First up, the ApplyPaletteCommand. This command lets you map a colored image into a specific palette, resulting in an 8-bit, 256-color image. It is available for DotImage Photo, Photo Pro, and Document Imaging.
Properties to consider:
- Palette – you can specify the colors you want the image mapped to with a new Palette.
- Dithering Mode – this is the algorithm used to colormap. Options include None, TwoValue, or FloydSteinberg
- Dither Error – the amount of dithering to apply. Should be between 0 and 127.
Here are the results, using the Standard Windows 16-color palette, FloydSteinberg, and 64:
Before (image’s pixel format is 24 bpp BGR):
After (image’s pixel format is 8 bpp indexed):
Tomorrow, the AutoCropCommand.