← Depth & Light

Depth & Light

When the Photo Has No Depth

Most photos are not Portrait photos. They were taken quickly, or years ago, or on something else entirely, and they carry no depth at all. The obvious response is to refuse them. The better one is to work out the depth from the picture itself — which a model on the device can now do well enough to light by, as long as everyone involved is honest about what an estimate is.

A single image has more depth cues than you think

People read distance from flat pictures constantly and without effort. A photograph of a corridor is unmistakably a corridor. The cues are all there in the image: things in front cover things behind, parallel lines converge, texture gets finer with distance, objects of known size announce their distance by how large they appear, haze softens the far end, and whatever the lens did not focus on is soft in a way that says how far it was from the focal plane.

Monocular depth estimation is a model trained to do what the eye does with those cues. Given one image, produce a depth value for every pixel. It is not measuring anything; it is recognizing, from an enormous amount of prior experience, the kind of scene it is looking at and what such scenes are usually shaped like. On ordinary photographs of ordinary things, it is very good.

The estimate has no units, and that is the real problem

These models are generally reliable about order and proportion and unreliable about absolute scale. The model will tell you the face is in front of the chair and the chair is in front of the wall, and it will be right. Ask it how far, in meters, and it has no basis for an answer. The same output would suit a face a meter away and a statue of a face ten meters away.

For deciding which way a surface faces, that is fine. For deciding what blocks what, it is fine. For light falling off with distance, it is not fine at all, because falloff is the one part of lighting that cares about real size. So a scale has to be invented, consistently, so that an estimated scene behaves roughly like a measured one. It works, and it is a fit rather than a fact.

Where it goes wrong, and what that looks like

The failures are specific and they are worth recognizing, because they show up as lighting mistakes rather than as depth mistakes, which makes them easy to misdiagnose.

Hair is the common one. Fine strands with background visible between them are not a surface, and a per-pixel depth value has to choose. The model tends to fill hair in as a solid mass, often at the wrong distance, and the result is a light that passes through it, or a shadow that falls across a face as though a helmet were casting it.

Glass, mirrors and polished surfaces get reported at the distance of whatever they are showing, which is usually badly wrong and sometimes behind the wall they are mounted on. Thin objects — a chair leg, a pair of glasses, a microphone stand — are thinner than the model's effective resolution and get smeared into their background. And a picture within a picture is read as the scene it depicts, so a poster on a wall becomes a hole in the room and a light swings into it.

None of these are subtle once you know them. All of them look, at first glance, like the light is in the wrong place.

Saying so

The interesting decision here is not technical. An app that estimates depth silently is making a promise it cannot keep: it is presenting a guess in exactly the visual language it uses for a measurement, and when the guess is wrong the user has no way to know why. They will move the light, which will not help, and conclude the tool is bad at lighting rather than that this particular photo has no shape behind it.

Telling the user that depth was estimated costs a line of text and changes the whole interaction. A shadow in an odd place stops being a mystery and becomes a known limitation with a known workaround: a Portrait photo of the same scene will fix it, and no amount of adjusting will. That is worth far more than the small amount of polish lost by admitting it.

It has to happen on the device, and it has to feel like nothing

Running the estimate locally is not only a privacy position, though it is that too — a photo that never leaves the device cannot be intercepted, retained or repurposed, and the guarantee needs no trust. It is also the only way the feature can be reliable. A network round trip means a photo that will not open on a train, and the point of a tool like this is that it always works.

The cost is time. A depth estimate is not instant, and it lands between choosing a photo and seeing it lit — the exact moment when nothing should feel slow. It cannot run where it would block the interface, and the wait has to be shown as the app doing a specific thing rather than as a pause. Held to that, a photo with no depth at all becomes a photo you can light. Slightly less faithfully, and by the same means.