Enum engiffen::Quantizer
[−]
[src]
pub enum Quantizer { Naive, NeuQuant(u32), }
A color quantizing strategy.
Naive
calculates color frequencies, picks the 256 most frequent colors
to be the palette, then reassigns the less frequently occuring colors to
the closest matching palette color.
NeuQuant
uses the NeuQuant algorithm from the color_quant
crate. It
trains a neural network using a pseudorandom subset of pixels, then
assigns each pixel its closest matching color in the palette.
Usage
Pass this as the last argument to engiffen
to select the quantizing
strategy.
The NeuQuant
strategy produces the best looking images. Its interior
u32 value reduces the number of pixels that the algorithm uses to train,
which can greatly reduce its workload. Specifically, for a value of N,
only the pixels on every Nth column of every Nth row are considered, so
a value of 1 trains using every pixel, while a value of 2 trains using
1/4 of all pixels.
The Naive
strategy is fastest when you know that your input images
have a limited color range, but will produce terrible banding otherwise.
Variants
Naive
NeuQuant(u32)
Trait Implementations
impl Debug for Quantizer
[src]
impl Eq for Quantizer
[src]
impl PartialEq for Quantizer
[src]
fn eq(&self, __arg_0: &Quantizer) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Quantizer) -> bool
This method tests for !=
.
impl Copy for Quantizer
[src]
impl Clone for Quantizer
[src]
fn clone(&self) -> Quantizer
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more