NeuralQuantizer class

Compute a color map with a given number of colors that best represents the given image.

Inheritance

Constructors

NeuralQuantizer(Image image, {int numberOfColors = 256, int samplingFactor = 10})
10 is a reasonable samplingFactor according to https://scientificgems.wordpress.com/stuff/neuquant-fast-high-quality-image-quantization/.

Properties

bgColor ↔ int
getter/setter pair
cutNetSize ↔ int
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
initBiasRadius ↔ int
getter/setter pair
initRadius ↔ int
getter/setter pair
maxNetPos ↔ int?
getter/setter pair
netSize ↔ int
getter/setter pair
numColors → int
How many colors are in the colorMap?
no setter
palette ↔ PaletteUint8
getter/setter pairoverride-getter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
samplingFactor ↔ int
getter/setter pair
specials ↔ int
getter/setter pair

Methods

addImage(Image image) → void
Add an image to the quantized color table.
getColorIndex(Color c) → int
Find the index of the closest color to c in the colorMap.
override
getColorIndexRgb(int r, int g, int b) → int
Find the index of the closest color to r,g,b in the colorMap.
override
getIndexImage(Image image) → Image
Convert the image to a palette image.
inherited
getQuantizedColor(Color c) → Color
Find the color closest to c in the colorMap.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

alphaBiasShift → const int
alphaRadiusBias → const int
alphaRadiusBiasShift → const int
beta → const double
betaGamma → const double
gamma → const double
initAlpha → const int
maxPrime → const int
numCycles → const int
prime1 → const int
prime2 → const int
prime3 → const int
prime4 → const int
radiusBias → const int
radiusBiasShift → const int
radiusDec → const int
smallImageBytes → const int