History & colour

How a Photo Becomes a Numbered Canvas: Behind the Algorithm

A plain-language look at how Wabihana turns a photo into a paint-by-numbers — quantization, regions, and cleanup — and why it’s deterministic image processing, not AI.

When you upload a photo, it becomes a paint-by-numbers in a few seconds — no artist redraws it, and, despite what you might assume in 2026, no AI image model is involved. It’s a chain of deliberate, repeatable image-processing steps: read the colours, reduce them to a fixed palette, find the regions, clean up the noise, and draw the outlines and numbers. Here’s what each step actually does, in plain language.

Step 1: Read the colours in your photo

A photo can contain tens of thousands of distinct colours — every subtle gradient in a sky is dozens of near-identical blues. You can’t paint that, and you wouldn’t want to. So the first job is to understand the colours that are genuinely in your image: which hues appear, how often, and how they cluster together. Nothing is invented here; the palette comes entirely from your own pixels.

Step 2: Reduce to a fixed palette (quantization)

Next comes colour quantization — the heart of the whole thing. The image’s huge set of colours is reduced to a small, fixed palette: 16 for a Sketchy painting, up to 128 for an Insane one. The algorithm chooses the palette that best represents the photo, then maps every pixel to its nearest palette colour. That’s why a sunset gets warm oranges and a snow scene gets cool greys — the palette is fitted to the picture, not chosen from a jar.

1
2
3
4
5
6
7
8
9
10
11
12
Thousands of photo colours reduced to a small, numbered palette — one number per paint.

This is a classic, well-understood technique — the same family of algorithms that once squeezed photos into 256-colour GIFs. It’s deterministic: the same photo at the same settings produces the same palette every time. There’s no randomness and no guessing about what the picture “should” look like.

Step 3: Find the regions

Once every pixel wears one of a handful of colours, neighbouring pixels of the same colour form contiguous shapes. Detecting those shapes — connected patches of a single colour — turns a flat colour map into regions: the numbered zones you’ll actually paint. A simple photo might become a few hundred; a detailed one, several thousand.

Same scene, coarse to fine. More regions hold more of the photo's detail — and take longer to paint.

Step 4: Clean up the noise

Real photos are grainy, and a naïve pass leaves a confetti of single-pixel specks that would be impossible to paint. So the pipeline cleans up: tiny regions get absorbed into the larger neighbour they most resemble, edges are kept crisp rather than smeared, and speckle along borders is smoothed away. The goal is a canvas where every region is big enough to see and fill, without losing the details that make the picture recognisable — a thin highlight in an eye, the edge of a jaw, the line of a horizon.

Step 5: Draw the outlines and numbers

Finally, the boundaries between regions become the outlines you see, each region is labelled with its palette number, and the palette itself becomes your colour key. The result is stored as a compact map of regions plus the palette and a thumbnail — everything needed to render and play the painting, and to produce a printable blank canvas if you’d rather paint it by hand.

What this means for you

Because it’s deterministic image processing rather than a generative model, three things follow. It’s fast — seconds, not minutes. It’s faithful — the output is built from your real colours and shapes, not a machine’s reinterpretation of them. And it’s private: your photo is used only to build the scene and is deleted from the servers within seven days, and it’s never used to train any AI model. You can read the specifics in our Privacy Policy.

It also explains why the photo you start with matters so much. The algorithm can only work with the colour and detail actually present in your image — which is exactly what the photo-choosing guide is about — and why picking a detail level is really about how many regions and colours you want, covered in how color count changes difficulty.

Frequently asked questions

Does Wabihana use AI to make the painting?
No. The conversion is a deterministic image-processing pipeline — colour quantization and region detection — not a generative AI or machine-learning model. The same photo at the same settings always produces the same result, and your photos are never used to train any model.
Where do the paint colours come from?
From your photo. Quantization fits a small, fixed palette (16 to 128 colours depending on the detail level) to the actual colours in your image, then maps every pixel to the nearest one. The palette is built from your picture, not chosen from a preset.
Why do some photos produce cleaner paintings than others?
The algorithm can only use the colour and detail that are actually in the photo. Clear light, good contrast, and enough resolution give it distinct regions to find; dark, blurry, or low-contrast photos give it mush, so the regions come out muddy.
What is a “region” or “zone”?
A contiguous patch of a single palette colour — one numbered shape you fill in. A simple photo becomes a few hundred regions; a highly detailed one, several thousand. More regions means a longer, more detailed paint.

Turn your own photo into a paint-by-numbers

Free to start, private, and ad-free while you paint — on web and Android.

Start painting
How a Photo Becomes a Numbered Canvas: Behind the Algorithm · Wabihana