blob: 0db61d05753360dd1d6b8b0e5f95f650b356f445 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
Colorsquash is a colour quantization[^1] crate and algorithm.
At it's core, it sorts the unique colours that appear in an image
and selects the most frequent that are sufficiently different.
To put it more clearly:
The most frequent colour is always selected and placed into the palette.
If the second most frequent colour is *different enough*, it will be selected
as well. If it's not, it is skipped and the third one is tried. This continues
until it selects the necessary amount of colours.
[^1] (wikipedia: color quantization)[https://en.wikipedia.org/wiki/Color_quantization]
### squash
A CLI tool to quantize colours. Accepts a path to a PNG; exports an indexed PNG.
|