https://github.com/baldomo/paletter
CLI app and library to extract a color palette from an image through clustering
https://github.com/baldomo/paletter
colors golang image-processing kmeans palette
Last synced: 7 months ago
JSON representation
CLI app and library to extract a color palette from an image through clustering
- Host: GitHub
- URL: https://github.com/baldomo/paletter
- Owner: Baldomo
- License: gpl-3.0
- Created: 2020-03-22T11:08:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-26T18:27:15.000Z (about 1 year ago)
- Last Synced: 2025-03-27T02:06:59.638Z (7 months ago)
- Topics: colors, golang, image-processing, kmeans, palette
- Language: Go
- Homepage:
- Size: 1.67 MB
- Stars: 16
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Paletter
Paletter is a CLI app and library to extract a color palette from an image through clustering (k-Means)
Example output:

### Installation
To install paletter just use:
```sh
$ go get -u -v github.com/Baldomo/paletter
```
To install the CLI app use:
```sh
$ go install -v github.com/Baldomo/paletter/cmd/paletter
```
### Usage (CLI)
```
Usage: paletter [OPTIONS]
Flags:
-colors int
Number of colors to extract from the image (default 7)
-html
Output an html page
-out string
Set output file name/path
-png
Output a png image (default true)
```
The CLI app outputs `png` images of resolution dependent on the source image (see `genimage.go` for calculations), with the extracted palette ordered by lightness from left to right
---
### Notes
- Paletter uses the [CIE L\*a\*b\* color space](https://en.wikipedia.org/wiki/CIELAB_color_space) both for the simplicity of its representation and it being device-indipendent
- The k-Means implementation included in paletter is the naive one ([muesli/kmeans](https://github.com/muesli/kmeans/))