Mosaic generator with k-means color palette