image-palette

Crates.ioimage-palette
lib.rsimage-palette
version0.1.1
sourcesrc
created_at2024-05-07 08:18:07.287733
updated_at2024-05-07 13:21:24.202013
descriptionA Rust library for automatically extracting prominent color palettes from images.
homepagehttps://github.com/siminx/image_palette
repositoryhttps://github.com/siminx/image_palette
max_upload_size
id1231962
size12,230
大司命 (siminx)

documentation

README

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());
  }
}
Commit count: 6

cargo fmt