#color #colors #quantization #reduce

color_quant

Color quantization library to reduce n colors to 256 colors

2 stable releases

1.0.1 Jun 13, 2018
1.0.0 May 29, 2015
Download history 5857/week @ 2019-01-21 5789/week @ 2019-01-28 5628/week @ 2019-02-04 6341/week @ 2019-02-11 6087/week @ 2019-02-18 5808/week @ 2019-02-25 6220/week @ 2019-03-04 6275/week @ 2019-03-11 5891/week @ 2019-03-18 6643/week @ 2019-03-25 6223/week @ 2019-04-01 8026/week @ 2019-04-08 7508/week @ 2019-04-15 8443/week @ 2019-04-22 7799/week @ 2019-04-29

13,496 downloads per month
Used in 39 crates (5 directly)

MIT license

18KB
306 lines

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();

lib.rs:

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();

No runtime deps