A fast and simple command-line tool written in C# to quantize an image into a reduced color palette using K-Means clustering.

📷 Photo by Ave Calvar Martinez
- Fast and efficient color quantization
- Reduces colors using K-Means clustering
- Automatically ignores fully transparent pixels
- Supports common image formats: PNG, JPG, etc.
- Outputs a clean version with a defined number of dominant colors
- Easy to run, customize, and extend from the command line
dotnet run -- Images/<FileName> (optional: <NumberOfColors>)- Clone the repository:
git clone https://github.com/mdomnik/ImageColorQuantizer.git
- Navigate to the project directory:
cd ImageColorQuantizer - Restore dependencies:
dotnet restore .\Image_ColorQuantizer.sln - Run the tool:
dotnet run -- Images/input.png 4
Below is an example of the tool applied to a colorful image, showing different quantization levels side by side:
📷 Photo by Alex P: https://www.pexels.com/photo/blue-and-yellow-macaw-perched-on-twig-2078772/