Clustering the pixels in a image to create a new image with minimum number of pixels