· updated 24 August with the 115-photo detector study · data: implementation, decision record, lab bench
The most common worry about AI colourisation is that the model is repainting the photograph — that grandma's face is now partly an invention. In this pipeline that is ruled out by construction, not by promise: the colouriser[1] is only allowed to contribute colour, never detail. This note explains the mechanism; then — new in this revision — it evaluates the 40 lines of arithmetic that decide when colourisation runs, on 115 labeled photographs: real black-and-white scans, a real 1867 albumen print, three families of chemically toned prints, real colour, and synthetically faded colour. The detector is perfect on every monochrome family, 88% on real colour — and on faded colour it collapses to 8%, for a reason no threshold can fix: sufficiently faded colour is monochrome, mathematically.
100%on every monochrome familyB&W, sepia, selenium, cyanotype — 66/66
88%on real colourthe 3 misses are one-hue scenes
8%on faded colourand the math says why
Every number in this note was measured on the production pipeline code — same models, same math. Raw per-image records: e4_mono.json.
1 · The mechanism: luminance is untouchable
Every image separates into luminance (the black-and-white structure — edges, texture, faces, light) and chroma (the colour laid over it). We colourise in CIELAB space, which makes the separation explicit: the photograph keeps its own L channel, bit for bit, and the model contributes only the two colour channels (a and b). Recombine and you get the original photo wearing estimated colour. If the colour model is having a bad day, the failure is a wrong tint — never a changed face, a moved edge, or invented texture.
ScanB&W photo
→L channelstructure — passes through
→a·b channelscolour — from the model
→Resultsame detail, new colour
Figure 1. The channel split. The model never sees a path by which it could alter structure: luminance flows through unmodified.
BeforeAfter
Figure 2. Colourisation as part of a full restoration: an 1862 glass-plate scan, and the result from this site's tool — the colour is estimated; the detail is the photograph's own. August 2026.
2 · When does it run? The mathematics of “is this sepia?”
Colourisation runs automatically only when the photo is measured to be monochrome, and sepia is what makes that non-obvious. The naive test — r ≈ g ≈ b everywhere — catches neutral black-and-white and nothing else. But a sepia print is emphatically chromatic: every pixel carries colour. What makes it monochrome is that all of its colour points the same direction — chemistry tones a print with one compound, so hue is constant while chroma scales with density. Direction, not magnitude, is the fingerprint.
So the detector samples up to 20,000 pixels in Lab space and keeps three statistics: the chromatic fraction (share of pixels with chroma above a 2-unit noise floor), the mean chroma C̄, and the interesting one — the hue concentration, which is the mean resultant length of the unit hue vectors, straight out of directional statistics[2]:
R̄ = ‖ Σi ui ‖ / n, ui = (ai, bi) / Ci(1)
R̄ lives in [0, 1]: exactly 1 means every chromatic pixel agrees on hue (a perfect tint); near 0 means hues cancel around the circle (skin arguing with sky — a colour photograph). The production rule is two clauses:
Figure 3. One Kodak scene through the corpus generators. Measured hue concentration R̄, left to right: 0.65 (original colour), 0.00 (neutral B&W), 1.00 (sepia), 1.00 (cyanotype), 0.86 (fade 50%), 0.96 (fade 82%). Watch the last number — fading raises R̄, and that is the whole problem of Section 4.
Group
n
correct
rate
Real B&W scans
5
5
100%
Real albumen print (1867)
1
1
100%
Synthetic neutral grayscale
6
6
100%
Sepia tints (×3 strengths)
18
18
100%
Selenium tints
18
18
100%
Cyanotype tints
18
18
100%
Real color photos
25
22
88%
Faded color (synthetic)
24
2
8%
Every monochrome family classifies perfectly — including the one genuine 19th-century print, which lands at R̄ = 0.946, C̄ = 8.0, comfortably inside the region. The scatter shows the whole corpus at once, with the decision region shaded:
Figure 4. The decision plane: hue concentration R̄ against mean chroma C̄, one point per photo (neutral B&W stacks at the origin; the tint families form the dense column at R̄ ≈ 1). The shaded box is clause two of Eq. 2. Three real colour photos (blue) intrude — a forest stream, a jet on tarmac, a moored boat: scenes that genuinely are one hue. And the faded set (gold) marches steadily into the box as fading pushes R̄ toward 1.
The three real-colour false positives are worth naming, because they are not noise — they are photographs of monochromatic scenes: Kodak's forest stream (R̄ 0.93), the parked jet (R̄ 0.96), a boat at dusk. The statistic is doing its job; those scenes really do concentrate their hue. The failure is semantic, not mathematical — which is precisely why the Colorize treatment is a visible, uncheckable toggle rather than a silent decision.
4 · The region where no threshold can win
Now the gold points. Fade a colour photo and two things happen at once: C̄ shrinks (the dyes are dying) and R̄ rises — what survives fading is not a fair sample of the original hues but the residue plus the print's cast, and a cast is by definition directional. At 50% fade our corpus averages R̄ ≈ 0.95; at 82% fade, R̄ ≈ 0.98 with C̄ ≈ 9. Compare Eq. 2: that is the tint signature. A heavily faded colour photo has not drifted near the sepia class — it has joined it.
Figure 5. Corpus accuracy as the R̄ threshold sweeps (chroma cut held at 22). Accuracy climbs all the way to 0.98 — but from 0.96 upward the gain is bought by ejecting the one genuine albumen print (R̄ = 0.946) from the monochrome class: the only false negative in the sweep. Synthetic tints score R̄ ≥ 0.998; real 19th-century chemistry wanders. Tuning to 0.98 would be overfitting to our own generator.
So the threshold is a values choice dressed as a number. Push R̄ to 0.98 and the corpus score rises ten points — while the classifier quietly starts failing the exact artifacts the feature exists for: real toned prints, whose century-old chemistry wanders in hue far more than any synthetic tint. Production stays at 0.92 to hold margin for real chemistry, accepts the faded region as genuinely ambiguous — and asks you, because a photo that has lost 82% of its colour is one its owner may well want recolourised. The table above calls those 22 photos “wrong”; their owners might call half of them “please do.”
5 · What colourisation honestly is
An estimate. The model has seen enough photographs to know grass is green and 1860s wool coats are usually dark blue — but it cannot know that your grandmother's dress was red, not green. Where a colour is historically knowable the estimate is often convincing; where it isn't, the model picks something plausible. That is why the honest framing is “natural colour, added” rather than “the original colours, recovered” — and why the option to keep a photo black-and-white exists. The structure — the faces, the light, the moment — is always the photograph's own, by the mechanism of Section 1. The same Lab-space trick runs in reverse in our face rendering, where the face model contributes only luminance and the photograph keeps its chroma.
6 · Limitations
One real toned print. The albumen Herschel anchors the realism argument but is a single sample; a dated corpus of tintypes, albumens and cyanotypes is the obvious follow-up.
Synthetic fading is kind to the detector. Real chromogenic fade is dye-selective (cyan dies first — that's why 70s prints go red), which pushes R̄ up even faster than our uniform model.
Sampling bias, by design: tiny coloured details — a lone red brooch on a sepia portrait — can hide below the chromatic-fraction radar. The bias is deliberately toward preserving tints.
References
Antic, J. (2019). DeOldify: A Deep Learning based project for colorizing and restoring old images. Open-source software. github.com
Mardia, K. V., & Jupp, P. E. (2000). Directional Statistics. Wiley. (The mean resultant length R̄ behind our hue-concentration statistic.) onlinelibrary.wiley.com
Kodak Lossless True Color Image Suite — 24 uncompressed 768×512 PhotoCD reference images, the classic image-quality test set. r0k.us
Cameron, J. M. (1867). Portrait of Sir John Herschel — a real albumen print with genuine chemical toning. Public domain, via Wikimedia Commons. commons.wikimedia.org
Lange, D. (1936). “Migrant Mother” (Destitute pea pickers in California), Farm Security Administration. Public domain, via Wikimedia Commons. commons.wikimedia.org
ONNX Runtime — the inference engine both our server (CPU) and in-browser (WebGPU/WASM) engines run on. onnxruntime.ai