|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||
|
This method allows you to do color reduction on a bitmap using a variety of palette, dither and color options. You can use many formats of palette, see ColorPaletteType. Additionally you may need to supply a number of colors for the color reduction. The dither parameter determines whether dithering is performed when the colors in the image are reduced. ImageGlue uses a highly optimized Floyd-Steinberg diffusion dither for speed and quality. Please note that video drivers expect that colors like black and white will always be present in an image. ImageGlue may remove these colors if they are not required. This means you may have problems drawing one color reduced bitmap onto another. |
|||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||
|
[C#]
The code above reduces the image to 64 level grayscale and then saves it as a JPEG. Two sample images are shown below.
|