The Problem
Converting a photo into a LEGO mosaic sounds simple: resize the image, find the closest LEGO color for each pixel, done.
Except it looks terrible. Skin tones turn green. Hair becomes a muddy blob. The algorithm picks colors that are mathematically close in RGB but perceptually wrong.
The Solution: OKLab Color Space
I switched from RGB to . Free to try, free (during launch period) for the full parts list.
Faces look like faces. Fur looks like fur. It's not perfect, but it's a massive improvement over naive RGB matching.
Built with vanilla JS, Canvas API, and Web Workers. No framework, no bundler.
SOCIAL SHARE CARD GENERATOR