Crates.io | auto-palette-cli |
lib.rs | auto-palette-cli |
version | 0.9.1 |
source | src |
created_at | 2024-05-19 06:16:26.994754+00 |
updated_at | 2025-06-15 06:30:51.760669+00 |
description | 🎨 CLI tool to extract a prominent color palette from an image. |
homepage | https://github.com/t28hub/auto-palette |
repository | https://github.com/t28hub/auto-palette |
max_upload_size | |
id | 1244714 |
size | 102,550 |
auto-palette-cli
🎨 A CLI tool to extract color palettes from images using the
auto-palette
crate.
dbscan
, dbscan++
, kmeans
, slic
, and snic
. (default: dbscan
).colorful
, vivid
, muted
, light
, and dark
.hex
, rgb
, cmyk
, hsl
, hsv
, lab
, luv
, lchab
, lchuv
, oklab
, oklch
, xyz
). (default: hex
).json
, text
, and table
. (default: text
).cargo install auto-palette-cli
Extract a simple 5 color palette from an image:
auto-palette path/to/your_image.jpg
Extract a 5 color palette from an image using the vivid
theme and rgb
color format with table
output format:
auto-palette path/to/your_image.jpg -n 5 -a dbscan++ -t vivid -c rgb -o table
Extract a color palette from clipboard image:
auto-palette --clipboard
$ auto-palette -h
🎨 CLI tool to extract a prominent color palette from an image.
Usage: auto-palette [OPTIONS] [PATH]
Arguments:
[PATH] Path to the image file, or supply --clipboard
Options:
-a, --algorithm <ALGORITHM> Extraction algorithm [default: dbscan] [possible values: dbscan, dbscan++, kmeans, slic, snic]
-t, --theme <THEME> Swatch theme [possible values: colorful, vivid, muted, light, dark]
-n, --count <N> Number of swatches [default: 5]
-c, --color-space <SPACE> Output color space [default: hex] [possible values: hex, rgb, cmyk, hsl, hsv, lab, luv, lchab, lchuv, oklab, oklch, xyz]
-o, --output-format <FORMAT> Output format [default: text] [possible values: json, text, table]
--no-resize Disable image resizing before extracting the color palette.
--clipboard Read image from system clipboard instead of a file.
-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.