Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nwin committed May 29, 2015
0 parents commit 1ed6c98
Show file tree
Hide file tree
Showing 4 changed files with 462 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target
Cargo.lock
.*
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "color_quant"
license = "MIT"
version = "1.0"
authors = ["nwin <[email protected]>"]
readme = "README.md"
repository = "https://github.com/PistonDevelopers/color_quant.git"

11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Color quantization library
This library provides a color quantizer based on the [NEUQUANT](http://members.ozemail.com.au/~dekker/NEUQUANT.HTML)
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();

Loading

0 comments on commit 1ed6c98

Please sign in to comment.