This project implements K-Means Clustering for color quantization in images, allowing you to reduce the number of colors while preserving visual quality. The implementation is currently in NumPy, and a CUDA-accelerated version is in progress.
- Perform K-Means clustering on images to reduce colors.
- Adjustable number of clusters (K).
- Supports custom images via GUI.
- Tracks execution time for performance evaluation.
- CUDA acceleration (WIP) to improve performance on large images.
git clone https://github.com/The-Silly-Glitch/Color-Quantization-using-K-means-Clustering.git
cd Color-Quantization-using-K-means-Clustering
python main.py
- Load an image.
- Set the number of clusters (K).
- Click Quantize to apply K-Means color reduction.
Original Image | Quantized Image (K=10) |
---|---|
![]() |
![]() |
- The CUDA implementation is under development using CuPy.
- Future improvements include faster distance calculations and parallel K-Means iterations.