#color-palette #image #automatic #extract #extracting #oct-tree #find

image-palette

一个用于从图像中自动提取突出颜色调板的 Rust 库

2 个版本

0.1.1 2024年5月7日
0.1.0 2024年5月7日

#480图像

每月 30 次下载

MIT 许可证

11KB
225

image_palette

🎨 一个用于从图像中自动提取突出颜色调板的 Rust 库。

使用八叉树算法,感谢 color-extraction

安装

要在您的 Rust 项目中使用 image-palette,请将其添加到您的 Cargo.toml

[dependencies]
image-palette = "0.1.0"

用法

以下是一个基本示例,演示如何提取颜色调板和查找主色。


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

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

依赖项

~2.5MB
~52K SLoC