10 releases
0.4.0 | Mar 6, 2023 |
---|---|
0.3.0 | Feb 22, 2020 |
0.2.4 | Feb 19, 2020 |
0.2.2 | Jun 29, 2019 |
0.1.2 | Jun 29, 2019 |
#368 in Images
1,603 downloads per month
Used in 2 crates
120KB
74 lines
Simple image color extractor written in Rust with no external dependencies
Demo:
https://dominant-color-demo.marekm4.com/
Blog post:
https://medium.com/@marek.michalik/c-vs-rust-vs-go-performance-analysis-945ab749056c
Usage:
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);
}
Example image:
Extracted colors: