K-means clustering for image segmentation with color quantization