C# Class ScreenToGif.ImageUtil.Quantitizer.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
Mostrar archivo Open project: dbremner/ScreenToGif

Public Methods

Method Description
NeuralColorQuantizer ( ) : System

Initializes a new instance of the NeuralColorQuantizer class.

NeuralColorQuantizer ( Byte quality ) : System

Initializes a new instance of the NeuralColorQuantizer class.

Protected Methods

Method 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 ( Bitmap image ) : void

See BaseColorQuantizer.OnPrepare for more details.

Private Methods

Method 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 method

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
return void

NeuralColorQuantizer() public method

Initializes a new instance of the NeuralColorQuantizer class.
public NeuralColorQuantizer ( ) : System
return System

NeuralColorQuantizer() public method

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

OnAddColor() protected method

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
return void

OnFinish() protected method

See BaseColorQuantizer.OnFinish for more details.
protected OnFinish ( ) : void
return void

OnGetPalette() protected method

See BaseColorQuantizer.OnGetPalette for more details.
protected OnGetPalette ( Int32 colorCount ) : List
colorCount System.Int32
return List

OnGetPaletteIndex() protected method

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
return void

OnPrepare() protected method

See BaseColorQuantizer.OnPrepare for more details.
protected OnPrepare ( Bitmap image ) : void
image System.Drawing.Bitmap
return void