3个稳定版本
使用旧的Rust 2015
1.1.0 | 2020年10月9日 |
---|---|
1.0.1 | 2018年6月13日 |
1.0.0 | 2015年5月29日 |
在 图像 中排名第485
每月下载量1,341,139次
在 3,605 个crate中(直接使用17个)中使用
19KB
345 行
颜色量化库
该库提供了一个基于Anthony Dekker的NEUQUANT量化算法的颜色量化器。
用法
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
:
颜色量化库
该库提供了一个基于NEUQUANT
原始文献:Dekker, A. H. (1994). Kohonen神经网络在最佳颜色量化中的应用. 网络:神经系统计算,5(3),351-367. doi: 10.1088/0954-898X_5_3_003
另请参阅https://scientificgems.wordpress.com/stuff/neuquant-fast-high-quality-image-quantization/
用法
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();