Skip to main content

Module wu

Module wu 

Source
Expand description

Wu’s color quantization method (Greedy Orthogonal Bipartitioning).

This preclustering method progressively splits the histogram box with the greatest variance along the dimension and bin that results in the greatest decrease in variance. It should give much better results than median cut while having nearly the same computational cost. Compared to k-means clustering (see the kmeans module), this quantization method is much faster, but gives less accurate results.

Currently, only colors with 3 u8 or 3 f32 components are supported via WuU8x3 and WuF32x3. Those two structs have the same API. See their documentation for more details and examples.

Structs§

BinnerF32x3
A histogram binner for colors consisting of 3 f32 components.
BinnerU8x3
A histogram binner for colors consisting of 3 u8 components.
WuF32x3
The struct for Wu’s color quantization method for colors with f32 components in 3 dimensions.
WuF32x3ColorMap
An IndexedColorMap that maps colors to histograms bins and the palette index or color associated with the histogram bin.
WuF32x3ParallelColorMap
An IndexedColorMap that, in parallel, maps colors to histograms bins and the palette index or color associated with the histogram bin.
WuU8x3
The struct for Wu’s color quantization method for colors with u8 components in 3 dimensions.
WuU8x3ColorMap
An IndexedColorMap that maps colors to histograms bins and the palette index or color associated with the histogram bin.
WuU8x3ParallelColorMap
An IndexedColorMap that, in parallel, maps colors to histograms bins and the palette index or color associated with the histogram bin.