blob: 288a923d70b489ec15165ccc3354ad3e5c2c3600 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
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 :D
Accepts JPEG and PNG as input and can output indexed PNG and GIF.
|