It uses K-means clustering to compress an image without affecting the quality much. It is to illustrate an application of K-means clustering algorithm in quantizing the colors present in the original image in only 'k' distinct colors.
Best thing would be to follow my blog-post for implementation. The description about compression of '.png' images with K-means and the steps to follow can be read from my blog:
https://appliedmachinelearning.wordpress.com/2017/03/08/image-compression-using-k-means-clustering/
I have uploaded one sample image of tiger in png format. The path used in the compress.py and decompress.py file can be checked accordingly.
It is a python implementation using Scikit-learn ML library.