A high Quality image which consist of millions of colors can't render in low memory device. So, by using K-Mean Clustering Algorithm we can easy compress the image. In the above code I have compressed 16-million possible color image to 16-color image.