| Crates.io | image-palette |
| lib.rs | image-palette |
| version | 0.1.8 |
| created_at | 2024-05-07 08:18:07.287733+00 |
| updated_at | 2025-09-25 13:45:06.353786+00 |
| description | A Rust library for automatically extracting prominent color palettes from images. |
| homepage | https://github.com/siminx/image_palette |
| repository | https://github.com/siminx/image_palette |
| max_upload_size | |
| id | 1231962 |
| size | 43,128 |
🎨 A Rust library for automatically extracting prominent color palettes from images.
Using octree algorithm, thanks for color-extraction.
To use image-palette in your Rust project, add it to your Cargo.toml.
[dependencies]
image-palette = "0.1"
Here is a basic example that demonstrates how to extract the color palette and find the dominant colors.
fn main() {
let (colors, width, height) = image_palette::load("test.jpg").unwrap();
println!("total: {}", width * height);
for color in colors {
println!("{}:{}", item.rgb().to_hex(), item.count());
}
}