Clustering algorithms for image compression