abrasion/third_party/cargo/vendor/color_quant-1.1.0
q3k 4a50bbf00d third_party/cargo: re-raze, fix winapi for windows 2021-05-03 23:43:36 +02:00
..
src third_party: bump everything 2021-01-07 23:38:16 +00:00
.cargo-checksum.json third_party: bump everything 2021-01-07 23:38:16 +00:00
BUILD.bazel third_party/cargo: re-raze, fix winapi for windows 2021-05-03 23:43:36 +02:00
CHANGELOG.md third_party: bump everything 2021-01-07 23:38:16 +00:00
Cargo.toml third_party: bump everything 2021-01-07 23:38:16 +00:00
LICENSE third_party: bump everything 2021-01-07 23:38:16 +00:00
README.md third_party: bump everything 2021-01-07 23:38:16 +00:00

README.md

Color quantization library

This library provides a color quantizer based on the NEUQUANT quantization algorithm by Anthony Dekker.

Usage

let data = vec![0; 40];
let nq = color_quant::NeuQuant::new(10, 256, &data);
let indixes: Vec<u8> = data.chunks(4).map(|pix| nq.index_of(pix) as u8).collect();
let color_map = nq.color_map_rgba();