How Floyd–Steinberg dithering improves cube mosaics

    A cube mosaic has six colours. A photograph has millions. The gap between those two numbers is bridged by one idea from 1976, and understanding it is the difference between a mosaic that looks like a photograph and one that looks like a badly posterised poster.

    The problem: quantisation and banding

    Converting an image to a limited palette is called quantisation. The naive method takes each pixel, finds the nearest available colour, and writes it down. It is fast, obvious, and produces two characteristic defects.

    The first is flattening. Every shade within a region gets the same answer, so a cheek that ran through eight distinct tones in the photograph becomes one slab of orange. All the modelling that made the face look three-dimensional disappears.

    The second is banding. Where a gradient slowly crosses the midpoint between two palette colours, every pixel on one side rounds down and every pixel on the other rounds up. The result is a hard edge running through what was a smooth transition — most obvious in skies, and the reason an un-dithered sunset mosaic looks like a set of coloured stripes.

    The idea: don't discard the error, spread it

    Robert Floyd and Louis Steinberg's insight was that rounding throws away information that could be reused. When a pixel wanting a colour halfway between yellow and orange is forced to yellow, the mosaic is nowtoo bright at that point by a measurable amount. That amount — the quantisation error — can be added to the pixels that have not been decided yet, making them more likely to round the other way.

    Floyd–Steinberg distributes the error to four not-yet-processed neighbours in fixed proportions: 7/16 to the pixel on the right, 3/16 down-left, 5/16 directly below, and 1/16 down-right. Processing runs left to right, top to bottom, so each of those neighbours is still ahead of the scan.

    The consequence is that error never accumulates. Across any small neighbourhood, the average colour of the chosen stickers tracks the average colour of the source image, even though no individual sticker is correct. The eye performs the averaging for you at viewing distance — the same mechanism that lets a newspaper photograph exist as black dots on white paper.

    What this looks like in cubes

    In a dithered portrait, a shadowed cheek is not a block of orange. It is orange with a scattering of yellow stickers whose density increases as the cheek brightens. Stand a metre away and you see individual coloured squares; stand three metres away and you see a continuous tone that the palette cannot actually produce.

    This is why dithering matters more in cube mosaics than in most digital image work. Your palette is fixed at six colours by physical hardware — you cannot add an intermediate shade the way a printer can. Error diffusion is the only tool that manufactures intermediate tones, and it does so from spatial mixing alone.

    Working in a perceptual colour space

    Error diffusion is only as good as the notion of "nearest colour" it is built on. Measuring distance in raw RGB numbers matches how a file is stored, not how a person sees, and it makes characteristic mistakes: it treats a small change in dark tones as equivalent to the same numeric change in bright tones, which humans do not.

    Our generator measures colour distance perceptually, weighting brightness the way human vision does, and its high-fidelity mode additionally preserves the luminance of the source pixel — so a shadow stays a shadow even when the chosen hue is a compromise. Getting value right and hue approximately right reads far better than the reverse, which is a rule worth remembering whenever a mosaic looks "washed out" rather than "wrong-coloured". The colour guide goes further into how the six sticker colours cover the visible range.

    When to switch dithering off

    Dithering is not universally correct. Turn it off for:

    Keep it on for photographs, portraits, skies, skin, and anything with a gradient you care about — which is most photographic subjects.

    Practical tuning checklist

    1. Raise source contrast slightly before uploading. Dithering reproduces tonal relationships; it cannot invent contrast that is not there.
    2. Compare the dithered and un-dithered previews at your intended cube count, not at maximum resolution — the right answer changes with size.
    3. If a sky still bands with dithering on, add a touch of noise to the source image; it breaks up the remaining regular boundaries.
    4. Judge the preview from across the room. Cube mosaics are viewed at distance, and every dithering decision looks wrong close up.

    Next: check the cube count and cost of your chosen resolution in the mosaic planner, see the technique applied to a photograph in the Mona Lisa case study, or just upload an image and toggle dithering to see the difference on your own subject.