#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 2389/week @ 2018-05-27 3795/week @ 2018-06-03 4069/week @ 2018-06-10 3636/week @ 2018-06-17 3457/week @ 2018-06-24 3906/week @ 2018-07-01 3947/week @ 2018-07-08 4126/week @ 2018-07-15 3474/week @ 2018-07-22 2914/week @ 2018-07-29 3935/week @ 2018-08-05 3357/week @ 2018-08-12 3424/week @ 2018-08-19

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