Crates.io | auto-palette-cli |
lib.rs | auto-palette-cli |
version | 0.5.0 |
source | src |
created_at | 2024-05-19 06:16:26.994754 |
updated_at | 2024-08-13 14:50:54.243824 |
description | 🎨 A CLI tool to extract prominent color palettes from images. |
homepage | https://github.com/t28hub/auto-palette |
repository | https://github.com/t28hub/auto-palette |
max_upload_size | |
id | 1244714 |
size | 86,664 |
auto-palette-cli
🎨 A CLI tool to extract color palettes from images using the
auto-palette
crate.
dbscan
, dbscan++
, kmeans
). Defaults to dbscan
.basic
, colorful
, vivid
, muted
, light
, dark
). Defaults to basic
.hex
, rgb
, cmyk
, hsl
, hsv
, lab
, luv
, lchab
, lchuv
, oklab
, oklch
, xyz
). Defaults to hex
.json
, text
, table
). Defaults to text
.cargo install auto-palette-cli
$ auto-palette --help
🎨 A CLI tool to extract prominent color palettes from images.
Usage: auto-palette [OPTIONS] <PATH>
Arguments:
<PATH> Path to the image file.
Options:
-a, --algorithm <name> Algorithm for extracting the color palette. [default: dbscan] [possible values: dbscan, dbscan++, kmeans]
-t, --theme <name> Theme for selecting the swatches. [possible values: basic, colorful, vivid, muted, light, dark]
-n, --count <number> Number of colors to extract. [default: 5]
-c, --color <name> Output color format. [default: hex] [possible values: hex, rgb, cmyk, hsl, hsv, lab, luv, lchab, lchuv, oklab, oklch, xyz]
-o, --output <name> Output format. [default: text] [possible values: json, text, table]
--no-resize Disable image resizing before extracting the color palette.
-h, --help Print help (see more with '--help')
-V, --version Print version
Here is an example of extracting the color palette from an image:
$ auto-palette path/to/your_image.jpg
#EB3739 (82, 293) 7751
#A24F01 (114, 129) 132
#FB9C04 (96, 155) 112
#D25A6E (58, 228) 20
#8DA502 (94, 84) 16
Here is an example of extracting the color palette from an image using the vivid
theme, the rgb
color format, and the table
output format:
$ auto-palette path/to/your_image.jpg -t vivid -n 6 -c rgb -o table
+---+--------------------+------------+------------+
| # | Color | Position | Population |
+---+--------------------+------------+------------+
| 1 | RGB(221, 226, 222) | (104, 96) | 6778 |
| 2 | RGB(3, 144, 149) | (114, 201) | 5476 |
| 3 | RGB(23, 37, 36) | (120, 300) | 4300 |
| 4 | RGB(36, 88, 131) | (183, 145) | 1348 |
| 5 | RGB(254, 29, 44) | (183, 190) | 779 |
| 6 | RGB(253, 213, 116) | (25, 158) | 567 |
+---+--------------------+------------+------------+
cargo run -- {image_path}
cargo nextest run --tests --all-features --package auto-palette-cli
This project is distributed under the MIT license. See the LICENSE file for more details.