PredefinedColorsQuantizer Class

Represents a quantizer with predefined set of colors. Use the static members to retrieve an instance. For using optimized colors for a specific source image see the OptimizedPaletteQuantizer class.
See the Remarks section of the static methods of this class for details and image examples.

Definition

Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 7.0.0
C#
public sealed class PredefinedColorsQuantizer : IQuantizer
Inheritance
Object    PredefinedColorsQuantizer
Implements
IQuantizer

Properties

AlphaThreshold Gets the alpha threshold value used by this PredefinedColorsQuantizer. This value will be returned also by the AlphaThreshold property once an IQuantizingSession is created from this instance.
See the Remarks section of the IQuantizingSession.AlphaThreshold property for details.
BackColor Gets the back color used by this PredefinedColorsQuantizer. This value will be returned also by the BackColor property once an IQuantizingSession is created from this instance. The A field of the returned color is always 255.
See the Remarks section of the IQuantizingSession.AlphaThreshold property for details.
Palette If this PredefinedColorsQuantizer is associated with a specific palette, then returns the same Palette that will be returned also by the Palette property once an IQuantizingSession is created from this instance; otherwise, returns .
PixelFormatHint Gets a KnownPixelFormat that is compatible with this PredefinedColorsQuantizer instance. If this PredefinedColorsQuantizer was not initialized with custom color mapping logic, then this is the possible lowest bits-per-pixel value format.

Methods

Argb1555 Gets a PredefinedColorsQuantizer instance that quantizes colors to 16-bit ones where alpha, red, green and blue components are encoded in 1, 5, 5 and 5 bits, respectively.
Argb8888 Gets a PredefinedColorsQuantizer instance that quantizes colors to the 32-bit ARGB color space.
BlackAndWhite Gets a PredefinedColorsQuantizer instance that quantizes every color to black or white.
FromBitmapData Gets a PredefinedColorsQuantizer instance that is compatible with the PixelFormat of the specified bitmapData and uses its Palette if bitmapData represents an indexed bitmap.
FromCustomFunction(FuncColor32, Color32, KnownPixelFormat) Gets a PredefinedColorsQuantizer instance that quantizes colors using the custom quantizer function specified in the quantizingFunction parameter.
FromCustomFunction(FuncColor32, Color32, Color, KnownPixelFormat, Byte) Gets a PredefinedColorsQuantizer instance that quantizes colors using the custom quantizer function specified in the quantizingFunction parameter.
FromCustomPalette(Palette) Gets a PredefinedColorsQuantizer instance that quantizes colors using the specified palette.
FromCustomPalette(Color, Color, Byte) Gets a PredefinedColorsQuantizer instance that quantizes colors using the colors in the specified palette.
FromPixelFormat Gets a PredefinedColorsQuantizer instance that is compatible with the specified pixelFormat.
See the Remarks section for details.
Grayscale Gets a PredefinedColorsQuantizer instance that quantizes colors to 8-bit grayscale ones of 256 shades.
Grayscale16 Gets a PredefinedColorsQuantizer instance that quantizes colors to 4-bit grayscale ones of 16 shades.
Grayscale4 Gets a PredefinedColorsQuantizer instance that quantizes colors to 2-bit grayscale ones of 4 shades.
Rgb332 Gets a PredefinedColorsQuantizer instance that quantizes colors to 8-bit ones where red, green and blue components are encoded in 3, 3 and 2 bits, respectively.
Rgb555 Gets a PredefinedColorsQuantizer instance that quantizes colors to 16-bit ones where each color component is encoded in 5 bits.
Rgb565 Gets a PredefinedColorsQuantizer instance that quantizes colors to 16-bit ones where red, green and blue components are encoded in 5, 6 and 5 bits, respectively.
Rgb888 Gets a PredefinedColorsQuantizer instance that quantizes colors to 24-bit ones where each color component is encoded in 8 bits.
SystemDefault1BppPalette Gets a PredefinedColorsQuantizer instance that quantizes colors using the system default 1-bit palette. This palette consists of the black and white colors.
SystemDefault4BppPalette Gets a PredefinedColorsQuantizer instance that quantizes colors using the system default 4-bit palette. This palette consists of the 16 standard basic sRGB colors.
SystemDefault8BppPalette Gets a PredefinedColorsQuantizer instance that quantizes colors using the system default 8-bit palette. This palette contains the 16 standard basic sRGB colors, the "web-safe" palette of 216 colors as well as 24 transparent entries.

Extension Methods

InitializeAsync Gets an IQuantizingSession instance potentially asynchronously that can be used to quantize the colors of the specified IReadableBitmapData instance. If quantizer is a known quantizer that can be evaluated quickly, then this method might be executed synchronously.
This method is available in.NET Framework 4.0 and above.
(Defined by QuantizerExtensions)

See Also