Image Compression using K-Means algorithm.
The script uses K-Means, a Machine Learning clustering algorithm, to cluster all the colors in an image into 16 clusters and replace the RGB value of every pixel with the RGB value of their respective cluster center and thus reducing the amount of memory required to save a picture.
Requirements
- Python
- numpy
- matplotlib
- Scipy
Instructions Download script.py in your required directory
Note Use a .png file as JPEG uses lossy compression which may lead to undesired result.
Author Krishna Heroor