Skip to content
CORVUS047Public

About

Image quantizer

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imq

A fast command-line image color quantizer written in Rust. Extract the dominant colors from an image and display them in your preferred color format, rendered with inline terminal color swatches.

Installation

Requires Rust (edition 2024 / Rust 1.85+).

git clone https://github.com/CORVUS047/imq
cd imq
cargo build --release

The binary will be at target/release/imq. Optionally, install it to your PATH:

cargo install --path .

Usage

imq --image <PATH> --color-format <FORMAT> [--quant <N>] [--visible-swath]

Options

Flag Short Description Default
--image -i Path to the image file required
--color-format -c Output color format (hex, rgb, hsl, cmyk) required
--quant -q Number of dominant colors to extract 5
--visible-swath -v Render inline terminal color swatches false

Examples

Extract the top 5 colors from an image as hex:

imq --image photo.jpg --color-format hex

Extract the top 8 colors in RGB with terminal swatches:

imq --image photo.jpg --color-format rgb --quant 8 --visible-swath

Extract colors in HSL for use in a script (no swatches):

imq --image photo.jpg --color-format hsl --quant 3

By default, output is plain text with no ANSI escape codes — safe to pipe into other programs. Pass --visible-swath to render inline terminal color swatches.

Supported Formats

Format Status
hex Supported
rgb Supported
hsl Supported
cmyk Supported
lab Planned

Supported Image Types

Format Status
JPEG / JPG Supported
PNG Supported
WebP Supported

About

Image quantizer

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages