makepad/libs/gif/color_quant
alanpoon 5416cdd25c
Added gif (#1083)
* added giphy

* added gif

* remove unnecessary file changes

* animated_image_git
2026-05-18 22:47:53 +02:00
..
src Added gif (#1083) 2026-05-18 22:47:53 +02:00
Cargo.toml Added gif (#1083) 2026-05-18 22:47:53 +02:00
Cargo.toml.orig Added gif (#1083) 2026-05-18 22:47:53 +02:00
CHANGELOG.md Added gif (#1083) 2026-05-18 22:47:53 +02:00
LICENSE Added gif (#1083) 2026-05-18 22:47:53 +02:00
README.md Added gif (#1083) 2026-05-18 22:47:53 +02:00

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