Skip to content

Commit 1c6460a

Browse files
authored
Update documentations for v0.7.0 release (#146)
1 parent fec8766 commit 1c6460a

File tree

5 files changed

+69
-25
lines changed

5 files changed

+69
-25
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
All notable changes to this project will be documented in this file.
4+
5+
## [v0.7.0](https://github.com/t28hub/auto-palette/releases/tag/v0.7.0)
6+
7+
* Introduced the ability to accept input directly from the system clipboard.(#140)
8+
* Modified the image crate usage to exclude default features, reducing the number of dependencies and optimizing build times.(#144)
9+
* Refactored the color module to optimize internal implementations and enhance color conversion accuracy.(#141)
10+
* Updated the find_swatches_with_theme method to employ diversity sampling strategies.(#136)
11+
12+
313
## [v0.6.0](https://github.com/t28hub/auto-palette/releases/tag/v0.6.0)
414

515
* Add methods to convert `Color` to and from `ColorInt` (integer representation).

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ members = ["crates/*"]
44

55
[workspace.package]
66
edition = "2021"
7-
version = "0.6.0"
7+
version = "0.7.0"
88
authors = ["Tatsuya Maki <[email protected]>"]
99
license = "MIT"
1010
homepage = "https://github.com/t28hub/auto-palette"
@@ -14,7 +14,7 @@ repository = "https://github.com/t28hub/auto-palette"
1414
anyhow = "1.0.97"
1515
arboard = "3.4.1"
1616
assert_cmd = "2.0.14"
17-
auto-palette = { version = "0.6.0", path = "crates/auto-palette", default-features = false }
17+
auto-palette = { version = "0.7.0", path = "crates/auto-palette", default-features = false }
1818
clap = { version = "4.5.4", features = ["cargo"] }
1919
getrandom = "0.3.1"
2020
image = { version = "0.25.1", default-features = false }

README.md

+19-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
# auto-palette
22

3-
> 🎨 `auto-palette` is a library that automatically extracts prominent color palettes from images, available for Rust ,Wasm and as a CLI tool.
3+
> 🎨 `auto-palette` is a library that automatically extracts prominent color palettes from images, available as Rust library, WebAssembly and CLI tool.
44
55
[![Build](https://img.shields.io/github/actions/workflow/status/t28hub/auto-palette/ci.yml?style=flat-square)](https://github.com/t28hub/auto-palette/actions/workflows/ci.yml)
66
[![License](https://img.shields.io/crates/l/auto-palette?style=flat-square)](https://crates.io/crates/auto-palette)
77
[![Version](https://img.shields.io/crates/v/auto-palette?style=flat-square)](https://crates.io/crates/auto-palette)
88
[![Codacy grade](https://img.shields.io/codacy/grade/5de09d1930244071a2fa39d5cfcd8633?style=flat-square)](https://app.codacy.com/gh/t28hub/auto-palette/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
99
[![Codecov](https://img.shields.io/codecov/c/github/t28hub/auto-palette?style=flat-square)](https://codecov.io/gh/t28hub/auto-palette)
1010

11+
## Overview
12+
`auto-palette` is a Rust project that offers color palette extraction from images. It consists of the following components:
13+
14+
* `auto-palette`: Core library for programmatic usage.
15+
* `auto-palette-cli`: Command-line interface for easy usage.
16+
* `auto-palette-wasm`: WebAssembly version for browser usage.
17+
18+
Perfect for developers, designers and anyone needing efficient color palette extraction.
19+
1120
## Features
1221

1322
<img src="gfx/laura-clugston-pwW2iV9TZao-unsplash.jpg" alt="Hot air balloon on blue sky" width="480">
@@ -17,24 +26,24 @@
1726
> Photo by <a href="https://unsplash.com/@laurahclugston?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Laura Clugston</a> on <a href="https://unsplash.com/photos/multi-colored-hot-air-balloon-pwW2iV9TZao?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Unsplash</a>
1827
1928
* Automatically extracts prominent color palettes from images.
20-
* Provides detailed information on color, position, and population.
21-
* Supports multiple extraction algorithms, including `DBSCAN`, `DBSCAN++`, and `KMeans++`.
22-
* Supports multiple color spaces, including `RGB`, `HSL`, and `LAB`.
23-
* Supports the selection of prominent colors based on multiple themes, including `Vivid`, `Muted`, `Light`, and `Dark`.
29+
* Provides detailed color swatch information (color, position, population)
30+
* Supports multiple extraction algorithms: `DBSCAN`, `DBSCAN++`, and `KMeans++`.
31+
* Supports numerous color spaces: `RGB`, `HSL`, `LAB`, `LCHuv`, `ANSI256` and more.
32+
* Theme-based swatch selection: `Basic`, `Colorful`, `Vivid`, `Muted`, `Light`, and `Dark`.
2433
* Available as a Rust library, Wasm, and a CLI tool.
2534

2635
## Installation
2736

28-
### Rust
37+
### Rust Library
2938

3039
To use `auto-palette` in your Rust project, add it to your `Cargo.toml`.
3140

3241
```toml
3342
[dependencies]
34-
auto-palette = "0.6.0"
43+
auto-palette = "0.7.0"
3544
```
3645

37-
### CLI
46+
### CLI Tool
3847

3948
To use command-line interface, install the `auto-palette-cli` crate.
4049

@@ -44,7 +53,7 @@ cargo install auto-palette-cli
4453

4554
## Usage
4655

47-
### Rust
56+
### Rust Example
4857

4958
Here is an example of extracting the color palette from an image using the Rust library.
5059
See the [examples](crates/auto-palette/examples) directory for more examples.
@@ -71,7 +80,7 @@ fn main() {
7180
}
7281
```
7382

74-
### CLI
83+
### CLI Example
7584

7685
Here is an example of extracting the color palette from an image using the CLI tool.
7786

crates/auto-palette-cli/README.md

+23-4
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,39 @@
99
## Features
1010

1111
- Extract prominent color palettes from images.
12-
- Supports multiple color extraction algorithms (`dbscan`, `dbscan++`, `kmeans`). Defaults to `dbscan`.
13-
- Supports multiple color selection themes (`basic`, `colorful`, `vivid`, `muted`, `light`, `dark`). Defaults to `basic`.
12+
- Supports multiple color extraction algorithms: `dbscan`, `dbscan++`, and `kmeans`. (default: `dbscan`).
13+
- Flexible theme selection for color swatches: `basic`, `colorful`, `vivid`, `muted`, `light`, and `dark`. (default: `basic`).
1414
- Supports multiple color formats (`hex`, `rgb`, `cmyk`, `hsl`, `hsv`, `lab`, `luv`, `lchab`, `lchuv`, `oklab`, `oklch`, `xyz`). Defaults to `hex`.
15-
- Outputs the color palette in multiple formats (`json`, `text`, `table`). Defaults to `text`.
15+
- Multiple output formats: `json`, `text`, and `table`. (default: `text`).
16+
- Clipboard support for instant palette extraction.
1617

1718
## Installation
1819

1920
```sh
2021
cargo install auto-palette-cli
2122
```
2223

24+
## Quick Start
25+
26+
Extract a simple 5 color palette from an image:
27+
```sh
28+
auto-palette path/to/your_image.jpg
29+
```
30+
31+
Extract a 5 color palette from an image using the `vivid` theme and `rgb` color format with `table` output format:
32+
```sh
33+
auto-palette path/to/your_image.jpg -n 5 -a dbscan++ -t vivid -c rgb -o table
34+
```
35+
36+
Extract a color palette from clipboard image:
37+
```sh
38+
auto-palette --clipboard
39+
```
40+
2341
## Usage
2442

2543
```sh
26-
$ auto-palette --help
44+
$ auto-palette -h
2745
🎨 A CLI tool to extract prominent color palettes from images.
2846

2947
Usage: auto-palette [OPTIONS] <PATH>
@@ -38,6 +56,7 @@ Options:
3856
-c, --color <name> Output color format. [default: hex] [possible values: hex, rgb, cmyk, hsl, hsv, lab, luv, lchab, lchuv, oklab, oklch, xyz]
3957
-o, --output <name> Output format. [default: text] [possible values: json, text, table]
4058
--no-resize Disable image resizing before extracting the color palette.
59+
--clipboard Get image from system clipboard
4160
-h, --help Print help (see more with '--help')
4261
-V, --version Print version
4362
```

crates/auto-palette/README.md

+15-9
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,22 @@
1818
1919
* Automatically extracts prominent color palettes from images.
2020
* Provides detailed information on color, position, and population.
21-
* Supports multiple extraction algorithms, including `DBSCAN`, `DBSCAN++`, and `KMeans++`.
22-
* Supports multiple color spaces, including `RGB`, `HSL`, and `LAB`.
23-
* Supports the selection of prominent colors based on multiple themes, including `Vivid`, `Muted`, `Light`, and `Dark`.
21+
* Supports multiple extraction algorithms: `DBSCAN`, `DBSCAN++`, and `KMeans++`.
22+
* Supports numerous color spaces: `RGB`, `HSL`, `LAB` and more.
23+
* Theme-based swatch selection: `Basic`, `Colorful`, `Vivid`, `Muted`, `Light`, and `Dark`.
2424

2525
## Installation
2626

2727
Using `auto-palette` in your Rust project, add it to your `Cargo.toml`.
2828

2929
```toml
3030
[dependencies]
31-
auto-palette = "0.6.0"
31+
auto-palette = "0.7.0"
3232
```
3333

3434
## Usage
3535

3636
Here is a basic example that demonstrates how to extract the color palette and find the prominent colors.
37-
See the [examples](./examples) directory for more examples.
3837

3938
```rust
4039
use auto_palette::{ImageData, Palette};
@@ -57,14 +56,16 @@ fn main() {
5756
}
5857
```
5958

60-
## API
59+
For more advanced examples, see the [examples](./examples) directory.
60+
61+
## Documentation
62+
63+
See the full documentation on [docs.rs](https://docs.rs/auto-palette/latest/auto_palette/).
6164

6265
* [`ImageData`](#imagedata)
6366
* [`Palette`](#palette)
6467
* [`Swatch`](#swatch)
6568

66-
For more information on the API, see the [documentation](https://docs.rs/auto-palette).
67-
6869
### `ImageData`
6970

7071
The `ImageData` struct represents the image data that is used to extract the color palette.
@@ -77,9 +78,14 @@ The `ImageData` struct represents the image data that is used to extract the col
7778
#### `ImageData::load`
7879

7980
Loads the image data from the file.
80-
The supported image formats are `PNG`, `JPEG`, `GIF`, `BMP`, `TIFF`, and `WEBP`.
8181
This method requires the `image` feature to be enabled. The `image` feature is enabled by default.
8282

83+
```toml
84+
[dependencies]
85+
auto-palette = { version = "0.7.0", features = ["image"] }
86+
image = { version = "0.25.6", features = ["jpeg"] } # if you want to load jpeg images
87+
```
88+
8389
```rust
8490
// Load the image data from the file
8591
let image_data = ImageData::load("path/to/image.jpg").unwrap();

0 commit comments

Comments
 (0)