#color-palette #automatic #image #extracting #dominant #prominent #🎨

image-palette

A Rust library for automatically extracting prominent color palettes from images

2 releases

0.1.1 May 7, 2024
0.1.0 May 7, 2024

#369 in Images

Download history 278/week @ 2024-05-05 4/week @ 2024-05-12 10/week @ 2024-05-19

292 downloads per month

MIT license

11KB
225 lines

image_palette

🎨 A Rust library for automatically extracting prominent color palettes from images.

Using octree algorithm, thanks for color-extraction.

Installation

To use image-palette in your Rust project, add it to your Cargo.toml.

[dependencies]
image-palette = "0.1.0"

Usage

Here is a basic example that demonstrates how to extract the color palette and find the dominant colors.


fn main() {
  let colors = image_palette::load("test.jpg").unwrap();

  for item in colors {
    println!("{}:{}", item.color(), item.count());
  }
}

Dependencies

~11MB
~51K SLoC