Quantization/palette-generation tool using k-means clustering on pixel data
| src | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
🎨 qtizer
command line quantization/palette-generation tool using k-means clustering on pixel data
features
- hex and rgb formats
- output with color previews
- various supported file types
usage
Usage: qtizer [OPTIONS] <input> [output]
Arguments:
<input> Input file path
[output] Output file path
Options:
-k <count> Number of colors to quantize to [default: 8]
-n <count> Number of k-means iterations to perform [default: 5]
-a, --with-alpha Include alpha channel
-s, --seed <number> Optional RNG seed for reproducible results
-o, --output <output> Output file path
- If not provided, outputs to stdout
- With image file extensions, outputs an image file
-f, --format <fmt> Palette output format [possible values: hex, rgb]
-h, --help Print help (see more with '--help')
-V, --version Print version
Example: palette creation in rgb format with alpha (output is colored accordingly in terminals):
$ qtizer wallpaper.png -k 3 -af rgb
rgba(254, 254, 254, 0)
rgba(191, 150, 132, 254)
rgba(48, 45, 51, 254)
Example: image quantization to reduced palette (file formats inferred based on extension):
$ qtizer wallpaper.png -k 8 quantized.png
installation
git clone https://github.com/mxhagen/qtizer
cd qtizer; cargo build --release
sudo cp target/release/qtizer /usr/local/bin