#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

#4 in Images

Download history 6572/week @ 2018-11-13 5179/week @ 2018-11-20 4766/week @ 2018-11-27 5646/week @ 2018-12-04 6221/week @ 2018-12-11 6163/week @ 2018-12-18 5213/week @ 2018-12-25 5362/week @ 2019-01-01 6158/week @ 2019-01-08 5896/week @ 2019-01-15 5969/week @ 2019-01-22 5809/week @ 2019-01-29 5712/week @ 2019-02-05 6190/week @ 2019-02-12 5944/week @ 2019-02-19

13,496 downloads per month
Used in 36 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