Brick mosaic
Turn a photo into a LEGO-compatible mosaic — crop it to 16, 32 or 48-stud baseplates, match it to real brick colours in CIELAB with ΔE2000 and optional dithering, limit it to the colours a piece comes in or to your own stock, and get a stud-rendered preview, piece counts with a cost, a BrickLink wanted list, a Rebrickable CSV and a printable build plan.
Added
Works with
- Retro image converter Retro computingreduce a picture to a fixed palette for a retro display instead
- Colour converter Numbers and bitsconvert a brick colour’s hex to other colour spaces and check contrast
- LDraw viewer and brick builder LEGO and brick buildingview LDraw models step by step with their parts lists, or build a small one on the stud grid
How to use it
Load a photo and it becomes a mosaic of 1×1 pieces in the colours bricks are actually made in, with a parts list you can order from and a plan to build it from. Everything happens in the page; the photo never leaves your browser.
How to use it
-
Load a photo with the button, drop one on the page, or paste one (⌘V / Ctrl+V). The samples (a flower, a sunset, a colour wheel) are drawn in the page if you just want to try it.
-
Crop it. The bright rectangle is what becomes the mosaic; drag it to move it and use the zoom slider (or the scroll wheel) to crop tighter. It keeps the mosaic’s shape. Brightness, contrast and saturation are applied before matching — a little extra contrast and saturation usually helps, because brick colours are fewer and flatter than a photo’s.
-
Choose the size. Pick the baseplate (16 × 16, 32 × 32 or 48 × 48 studs) and how many across and down; 2 × 2 of 48 is 96 × 96 studs, about 77 cm square. The dashed lines are the seams.
-
Choose the piece. 1×1 round plates give the classic mosaic look, tiles are flat and smooth, plates show their studs, and 1×1 bricks build the picture side-on as a wall (see below).
-
Choose the colours. "Colours made in this piece" uses only colours that exist for that part. "A custom subset" lets you untick colours; "My stock" uses only what you have, no more of each than the quantity you enter.
-
Dither if you like: Floyd–Steinberg spreads each cell’s colour error onto its neighbours, so areas between two brick colours become a mix of both; ordered dithering does the same with a regular 8 × 8 pattern, which looks tidier up close. Strength turns either down.
-
Merge same-colour runs into larger plates to cut the part count (and the cost, and the time spent placing 1×1s).
-
Export. BrickLink XML is a wanted list (on BrickLink: Want → Upload); Rebrickable CSV is a parts list for Rebrickable’s import; PNG saves the preview; Print build plan prints one page per baseplate with a colour grid, the symbol for every cell, a colour key and a row-by-row list.
The parts table shows each lot’s BrickLink item and colour, the LEGO element ID where Rebrickable has one, the quantity (with optional spares) and an estimated cost. The prices are rough averages for new parts bought loose — click a price to set your own; they are kept in this browser.
Studs-up or side-built
Round plates, tiles and plates are placed studs-up on a baseplate: one stud per cell, square cells 8 mm across. Bricks are built side-built — stacked like a wall and seen from the front — so each cell is 8 mm wide but one brick (9.6 mm) tall, and the photo is sampled on cells 1.2 times taller than wide; a 32-stud-wide section is 27 courses tall to stay about square. Columns of stacked 1×1 bricks don’t hold each other, so for a side-built mosaic either merge into longer bricks (they then overlap the joints in the course below only by chance — check the plan) or glue or pin a back panel on.
How the colours are matched
Each cell of the cropped photo is the average of a 4 × 4 block of pixels, averaged in linear light (so fine black-and-white detail comes out the grey it looks, not darker). The cell’s colour is converted from sRGB to CIELAB (D65 white) and compared with every brick colour in play using the CIEDE2000 colour difference, ΔE00 — the CIE’s 2001 formula, which corrects plain Lab distance for how much more sensitive the eye is to some hue and chroma differences than others. It is checked here against all 34 test pairs published by Sharma, Wu and Dalal. ΔE76 (straight-line Lab distance) is offered for comparison. Floyd–Steinberg error diffusion runs in Lab, scanning in a serpentine, with the classic 7/16, 3/16, 5/16, 1/16 weights; ordered dithering adds a Bayer 8 × 8 threshold to the cell’s sRGB value before matching. The mean ΔE in the summary is how far, on average, a cell’s piece is from the photo’s colour — under about 2 is hard to see, over 10 is a clearly different colour.
Limited stock. With "My stock", Greedy hands out pieces in build order (top-left first) and a colour that runs out is simply no longer offered. Best fit matches every cell freely and then, while a colour is over-used, moves the cells that lose least by switching to their next-best colour that still has pieces to spare. Best fit spends your scarce colours where they matter most; greedy is what happens if you build until a colour runs out. If you have fewer pieces than cells, the worst-fitting cells are left empty and the summary says how many.
Merging. The greedy tiler works from the top-left: each cell not yet covered takes the largest piece — 2 × 2, then 1 × 4, 1 × 3 and 1 × 2, either way round — that covers only uncovered cells of the same colour, exists in that colour, and (by default) stays on one baseplate. Round plates don’t merge; side-built bricks merge only along a course. Greedy isn’t the minimum possible part count, but it is close on photographic mosaics, where same-colour areas are irregular anyway.
Sources and assumptions
-
Colours. The palette is the solid colours in production in 2025–26 that are common in small plates, tiles and bricks — 43 of them, including two metallics (Pearl Gold and Flat Silver, off by default). Names, approximate sRGB values and which parts exist in which colour come from Rebrickable’s downloadable database (colors.csv and elements.csv, November 2026), used under its terms; BrickLink colour IDs and LEGO colour numbers are as BrickLink and Rebrickable list them. Screen colours of real plastic are approximations — the same colour looks different under different light, and your screen isn’t calibrated to ABS — so if a match matters, compare a real part.
-
Element IDs are the newest LEGO element ID for that part in that colour in Rebrickable’s data; colours with no element for a part are treated as not made in it.
-
Parts. 1×1 round plate (BrickLink 4073, Rebrickable 6141), 1×1 tile 3070b, 1×1 plate 3024, 1×1 brick 3005; for merging 1×2, 1×3, 1×4 and 2×2 plates (3023, 3623, 3710, 3022), tiles (3069b, 63864, 2431, 3068b) and bricks (3004, 3622, 3010); baseplates 16 × 16 (91405), 32 × 32 (3811) and 48 × 48 (4186).
-
Exports. The BrickLink XML follows BrickLink’s wanted-list upload format (an INVENTORY of ITEMs with ITEMTYPE, ITEMID, COLOR, MINQTY and CONDITION); the Rebrickable CSV is Part, Color, Quantity with Rebrickable part and colour numbers.
-
Size. A stud is 8.0 mm, a plate 3.2 mm thick and a brick 9.6 mm tall.
Feedback is a gift. Something to improve, a feature to add, or a bug? Tell me.
Runs entirely in your browser; nothing you type leaves this page.