k-means used to reduce the color palette