K-means clustering to encode an image using fewer colors.