color_quant 1.1.0

Color quantization library to reduce n colors to 256 colors.
Documentation
  • Coverage
  • 88.89%
    8 out of 9 items documented1 out of 9 items with examples
  • Size
  • Source code size: 21.28 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.51 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • image-rs/color_quant
    38 16 4
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • fintelia HeroicKatora github:image-rs:publish

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