Back to Cubing

Mosaic Generator

Upload any image to generate a Rubik's cube mosaic. Each cell is mapped to one of the 6 standard cube face colors using four different methods — compare the results to see how the algorithm choice changes the output.

Nearest Neighbor

Each pixel is independently mapped to its closest cube color by perceptual distance in LAB color space.

K-Means

Pixels are grouped into 6 clusters. Each cluster centroid is mapped to a cube color, so entire regions share one color.

Smoothed OR

Iterative local search that adds a bonus for matching the color of adjacent cells, producing more spatially coherent regions.

K-Means + Smoothed OR

K-means centroids define image-adaptive color costs, then spatial smoothing refines the result — combining the strengths of both methods.

Drop an image here or click to upload

Grid size (max 120)

×

Method

Color assignment