PredefinedColorsQuantizer Class

KGy SOFT Drawing Libraries Help
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.
Inheritance Hierarchy

SystemObject
  KGySoft.Drawing.ImagingPredefinedColorsQuantizer

Namespace:  KGySoft.Drawing.Imaging
Assembly:  KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 5.0.0
Syntax

public sealed class PredefinedColorsQuantizer : IQuantizer

The PredefinedColorsQuantizer type exposes the following members.

Properties

  NameDescription
Public propertyPixelFormatHint
Gets a PixelFormat 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.
Top
Methods

  NameDescription
Public methodStatic memberCode exampleArgb1555
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.
Public methodStatic memberCode exampleBlackAndWhite
Gets a PredefinedColorsQuantizer instance that quantizes every color to black or white.
Public methodStatic memberCode exampleFromCustomFunction(FuncColor32, Color32, PixelFormat)
Gets a PredefinedColorsQuantizer instance that quantizes colors using the custom quantizer function specified in the quantizingFunction parameter.
See the Remarks section for details and some examples.
Public methodStatic memberCode exampleFromCustomFunction(FuncColor32, Color32, Color, PixelFormat, Byte)
Gets a PredefinedColorsQuantizer instance that quantizes colors using the custom quantizer function specified in the quantizingFunction parameter.
See the Remarks section for details and some examples.
Public methodStatic memberFromCustomPalette(Palette)
Gets a PredefinedColorsQuantizer instance that quantizes colors using the specified palette.
See the Remarks section for details.
Public methodStatic memberCode exampleFromCustomPalette(Color, Color, Byte)
Gets a PredefinedColorsQuantizer instance that quantizes colors using the colors in the specified palette.
See the Remarks section for details and some examples.
Public methodStatic memberCode exampleGrayscale
Gets a PredefinedColorsQuantizer instance that quantizes colors to 8-bit grayscale ones of 256 shades.
See the Remarks section for details and some examples.
Public methodStatic memberCode exampleGrayscale16
Gets a PredefinedColorsQuantizer instance that quantizes colors to 4-bit grayscale ones of 16 shades.
See the Remarks section for details and some examples.
Public methodStatic memberCode exampleGrayscale4
Gets a PredefinedColorsQuantizer instance that quantizes colors to 2-bit grayscale ones of 4 shades.
See the Remarks section for details and some examples.
Public methodStatic memberCode exampleRgb332
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.
See the Remarks section for details and some examples.
Public methodStatic memberCode exampleRgb555
Gets a PredefinedColorsQuantizer instance that quantizes colors to 16-bit ones where each color component is encoded in 5 bits.
Public methodStatic memberCode exampleRgb565
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.
Public methodStatic memberCode exampleRgb888
Gets a PredefinedColorsQuantizer instance that quantizes colors to 24-bit ones where each color component is encoded in 8 bits.
See the Remarks section for details and some examples.
Public methodStatic memberSystemDefault1BppPalette
Gets a PredefinedColorsQuantizer instance that quantizes colors using the system default 1-bit palette. On Windows this palette consists of the black and white colors.
See the Remarks section for details.
Public methodStatic memberCode exampleSystemDefault4BppPalette
Gets a PredefinedColorsQuantizer instance that quantizes colors using the system default 4-bit palette. On Windows this palette consists of the 16 standard basic sRGB colors.
See the Remarks section for details and some examples.
Public methodStatic memberCode exampleSystemDefault8BppPalette
Gets a PredefinedColorsQuantizer instance that quantizes colors using the system default 8-bit palette. On Windows this palette contains the 16 standard basic sRGB colors, the "web-safe" palette of 216 colors as well as 24 transparent entries.
See the Remarks section for details and some examples.
Top
See Also

Reference