How photo colourisation works
Colourising a photo sounds like it should require rebuilding the whole image, but the clever part is that it doesn't. A colour image can be split into a brightness channel and two colour channels — and a black-and-white photo already is the brightness channel. So the model only has to supply what's missing: colour.
Lab, not RGB
The trick is to work in a colour space called Lab instead of RGB. Lab separates L (lightness — essentially your grayscale photo) from a and b (the two colour axes: green–red and blue–yellow). Your black-and-white photo maps directly onto L. The neural network takes L and predicts a and b — just two numbers per pixel. Then L (your original, at full resolution) is recombined with the predicted a and b, and the result is converted back to RGB. Because your real brightness is untouched, every bit of detail, grain and sharpness in the original survives; the model never redraws the picture, it only tints it intelligently.
Why the model can guess well
Predicting colour from brightness seems impossible — but the world is full of regularities the network learned from millions of photos. Skies are blue and lighter at the horizon; foliage is green; skin sits in a narrow band; wood and soil are brown; clouds are white. Given the shapes and textures in the L channel, the model infers the most likely colours. It genuinely can't know that a specific jumper was purple — for arbitrary man-made objects it makes a plausible guess — but for the natural and human content that fills most photos, its guesses are convincing. This tool runs that model (DDColor) entirely in your browser: L in, a and b out, recombined with your full-resolution original, colour added without a single pixel of your photo leaving the device.