C# Class SimplePaletteQuantizer.Quantizers.MedianCut.MedianCutQuantizer

The premise behind median cut algorithms is to have every entry in the color map represent the same number of pixels in the original image. In contrast to uniform sub-division, these algorithms divide the color space based on the distribution of the original colors. The process is as follows[2]: 1. Find the smallest box which contains all the colors in the image. 2. Sort the enclosed colors along the longest axis of the box. 3. Split the box into 2 regions at median of the sorted list. 4. Repeat the above process until the original color space has been divided into 256 regions. 5. The algorithm then divides the color space in a manner depicted below. 6. The representative colors are found by averaging the colors in each box, and the appropriate color map index assigned to each color in that box. Because these algorithms use image information in dividing the color space this class of algorithms consistently produce good results while having memory and time complexity no worse than popularity algorithms[1].
Inheritance: BaseColorCacheQuantizer
Afficher le fichier Open project: RHY3756547/FreeSO Class Usage Examples

Méthodes publiques

Méthode Description
GetPaletteIndex ( Color color, Int32 &paletteIndex ) : void

See IColorQuantizer.GetPaletteIndex for more details.

Méthodes protégées

Méthode Description
OnCreateDefaultCache ( ) : IColorCache

See BaseColorCacheQuantizer.OnCreateDefaultCache for more details.

OnFinish ( ) : void

See BaseColorQuantizer.OnFinish for more details.

OnGetPaletteToCache ( Int32 colorCount ) : List

See BaseColorCacheQuantizer.OnGetPaletteToCache for more details.

OnPrepare ( ImageBuffer image ) : void

See IColorQuantizer.Prepare for more details.

Private Methods

Méthode Description
SplitCubes ( Int32 colorCount ) : void

Splits all the cubes on the list.

Method Details

GetPaletteIndex() public méthode

See IColorQuantizer.GetPaletteIndex for more details.
public GetPaletteIndex ( Color color, Int32 &paletteIndex ) : void
color Color
paletteIndex System.Int32
Résultat void

OnCreateDefaultCache() protected méthode

See BaseColorCacheQuantizer.OnCreateDefaultCache for more details.
protected OnCreateDefaultCache ( ) : IColorCache
Résultat IColorCache

OnFinish() protected méthode

See BaseColorQuantizer.OnFinish for more details.
protected OnFinish ( ) : void
Résultat void

OnGetPaletteToCache() protected méthode

See BaseColorCacheQuantizer.OnGetPaletteToCache for more details.
protected OnGetPaletteToCache ( Int32 colorCount ) : List
colorCount System.Int32
Résultat List

OnPrepare() protected méthode

See IColorQuantizer.Prepare for more details.
protected OnPrepare ( ImageBuffer image ) : void
image SimplePaletteQuantizer.Helpers.ImageBuffer
Résultat void