NeuralQuantizer class
Compute a color map with a given number of colors that best represents the given image.
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
- colorMap ↔ Uint8List
-
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
- 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.
-
color(
int index) → int - Get a color from the colorMap.
-
getIndexMap(
Image image) → Uint8List -
Convert the
image
to an index map, mapping to this colorMap. -
getQuantizedColor(
int c) → int -
Find the color closest to
c
in the colorMap. -
lookup(
int c) → int -
Find the index of the closest color to
c
in the colorMap. -
lookupRGB(
int r, int g, int b) → int -
Find the index of the closest color to
r
,g
,b
in the colorMap. -
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