10 个版本
0.4.0 | 2023 年 3 月 6 日 |
---|---|
0.3.0 | 2020 年 2 月 22 日 |
0.2.4 | 2020 年 2 月 19 日 |
0.2.2 | 2019 年 6 月 29 日 |
0.1.2 | 2019 年 6 月 29 日 |
#305 在 图像
7,537 每月下载量
在 2 crate 中使用
120KB
74 行
使用 Rust 编写的简单图像颜色提取器,无外部依赖
演示
https://dominant-color-demo.marekm4.com/
博客文章
https://medium.com/@marek.michalik/c-vs-rust-vs-go-performance-analysis-945ab749056c
用法
use std::path;
fn main() {
let image = image::open(path::Path::new("docs/Fotolia_45549559_320_480.jpg")).unwrap();
let colors = dominant_color::get_colors(image.to_rgb8().into_raw().as_slice(), false);
println!("colors: {:?}", colors);
}
示例图像
提取的颜色