C# Class SimplePaletteQuantizer.Quantizers.NeuQuant.NeuralColorQuantizer

The NeuQuant Neural-Net image quantization algorithm (© Anthony Dekker 1994) is a replacement for the common Median Cut algorithm. It is described in the article Kohonen neural networks for optimal colour quantization in Volume 5, pp 351-367 of the journal Network: Computation in Neural Systems, Institute of Physics Publishing, 1994 (PDF version available).
Inheritance: BaseColorQuantizer
Afficher le fichier Open project: RHY3756547/FreeSO

Méthodes publiques

Méthode Description
NeuralColorQuantizer ( ) : System

Initializes a new instance of the NeuralColorQuantizer class.

NeuralColorQuantizer ( Byte quality ) : System

Initializes a new instance of the NeuralColorQuantizer class.

Méthodes protégées

Méthode Description
LearnNeuronNeighbors ( Int32 red, Int32 green, Int32 blue, Int32 networkIndex, Int32 radius ) : void

Spread the bias to neuron neighbors.

OnAddColor ( Color color, Int32 key, Int32 x, Int32 y ) : void

See BaseColorQuantizer.OnAddColor for more details.

OnFinish ( ) : void

See BaseColorQuantizer.OnFinish for more details.

OnGetPalette ( Int32 colorCount ) : List

See BaseColorQuantizer.OnGetPalette for more details.

OnGetPaletteIndex ( Color color, Int32 key, Int32 x, Int32 y, Int32 &paletteIndex ) : void

See IColorQuantizer.GetPaletteIndex for more details.

OnPrepare ( ImageBuffer image ) : void

See BaseColorQuantizer.OnPrepare for more details.

Private Methods

Méthode Description
FindClosestNeuron ( Int32 red, Int32 green, Int32 blue ) : Int32
LearnNeuron ( Int32 alpha, Int32 red, Int32 green, Int32 blue, Int32 networkIndex ) : void

Forces the strength of bias of the neuron towards certain color.

LearnSampleColor ( Color color ) : void
SortNetwork ( ) : void
UnbiasNetwork ( ) : void

Method Details

LearnNeuronNeighbors() protected méthode

Spread the bias to neuron neighbors.
protected LearnNeuronNeighbors ( Int32 red, Int32 green, Int32 blue, Int32 networkIndex, Int32 radius ) : void
red System.Int32
green System.Int32
blue System.Int32
networkIndex System.Int32
radius System.Int32
Résultat void

NeuralColorQuantizer() public méthode

Initializes a new instance of the NeuralColorQuantizer class.
public NeuralColorQuantizer ( ) : System
Résultat System

NeuralColorQuantizer() public méthode

Initializes a new instance of the NeuralColorQuantizer class.
public NeuralColorQuantizer ( Byte quality ) : System
quality Byte The quality.
Résultat System

OnAddColor() protected méthode

See BaseColorQuantizer.OnAddColor for more details.
protected OnAddColor ( Color color, Int32 key, Int32 x, Int32 y ) : void
color Color
key System.Int32
x System.Int32
y System.Int32
Résultat void

OnFinish() protected méthode

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

OnGetPalette() protected méthode

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

OnGetPaletteIndex() protected méthode

See IColorQuantizer.GetPaletteIndex for more details.
protected OnGetPaletteIndex ( Color color, Int32 key, Int32 x, Int32 y, Int32 &paletteIndex ) : void
color Color
key System.Int32
x System.Int32
y System.Int32
paletteIndex System.Int32
Résultat void

OnPrepare() protected méthode

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