Class WuAlphaColorQuantizer
A Wu's color quantizer with alpha channel.
Implements
Inherited Members
Namespace: JeremyAnsel.ColorQuant
Assembly: JeremyAnsel.ColorQuant.dll
Syntax
public sealed class WuAlphaColorQuantizer : IColorQuantizer
Remarks
Based on C Implementation of Xiaolin Wu's Color Quantizer (v. 2) (see Graphics Gems volume II, pages 126-133) (http://www.ece.mcmaster.ca/~xwu/cq.c).
Algorithm: Greedy orthogonal bipartition of RGB space for variance minimization aided by inclusion-exclusion tricks. For speed no nearest neighbor search is done. Slightly better performance can be expected by more sophisticated but more expensive versions.
Fields
| Edit this page View SourceMaxColors
The maximum color count for the quantize.
Declaration
public const int MaxColors = 256
Field Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceQuantize(byte[])
Quantizes an image.
Declaration
public ColorQuantizerResult Quantize(byte[] image)
Parameters
Type | Name | Description |
---|---|---|
byte[] | image | The image (ARGB). |
Returns
Type | Description |
---|---|
ColorQuantizerResult | The result. |
Quantize(byte[], int)
Quantizes an image.
Declaration
public ColorQuantizerResult Quantize(byte[] image, int colorCount)
Parameters
Type | Name | Description |
---|---|---|
byte[] | image | The image (ARGB). |
int | colorCount | The color count. |
Returns
Type | Description |
---|---|
ColorQuantizerResult | The result. |