dominant_color

Crates.iodominant_color
lib.rsdominant_color
version0.4.0
sourcesrc
created_at2019-06-29 10:15:27.050423
updated_at2023-03-06 08:16:43.514116
descriptionSimple image color extractor written in Rust with no external dependencies
homepage
repositoryhttps://github.com/marekm4/dominant_color
max_upload_size
id144514
size135,408
Marek Michalik (marekm4)

documentation

README

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:

Image

Extracted colors:

Colors

Commit count: 45

cargo fmt