Images and Photos

From Flat Photo to 3D: How AI Depth Maps and Parallax Animations Work

How monocular depth estimation works, what a depth map is used for, and how to create 3D parallax GIFs and portrait blur from a single photo.

Saizul Amin
Saizul Amin28 Oct 2026 · 3 min read
From Flat Photo to 3D: How AI Depth Maps and Parallax Animations Work

From Flat Photo to 3D: How AI Depth Maps and Parallax Animations Work

A normal photo is flat, yet you can tell at a glance that the person is in front of the wall and the mountains are far away. Computers can now make that judgement too. Depth estimation models predict how far away each point in a photo is, and that information unlocks effects such as moving 3D photos and realistic background blur. The AI Depth Map and 3D Photo tool runs one of these models in your browser.

What a depth map is

A depth map is a grey image the same shape as your photo, where brightness means distance. In the convention used here, bright is near and dark is far. Some software expects the opposite, so the tool lets you invert it. The values are relative: the model knows the cat is closer than the sofa but not that it is exactly 1.2 metres away.

How a single photo gives depth

With two eyes, or two cameras, depth comes from geometry. With one photo, the model has to rely on learned cues: objects lower in the frame are often nearer, distant things look hazier and smaller, textures get finer with distance, and familiar objects have familiar sizes. Depth Anything V2, the model used here, was trained on large collections of real and synthetic images to combine these cues. Its small version, released under the Apache-2.0 licence, is about 27 MB as an int8 file and runs on an ordinary computer in a few seconds.

Making a 3D photo

The classic "3D photo" effect moves a virtual camera slightly. Near objects shift more than far ones, which is exactly what happens when you move your head. The tool shifts each pixel by an amount proportional to its depth and renders a loop of frames along a path: left and right, up and down, or a circle. A small zoom hides the gaps that open at the edges of foreground objects. The result is saved as an animated GIF for messages and social posts.

Tips for convincing motion:

  • Choose photos with a clear foreground subject and a separate background.
  • Keep the movement small; 15 to 25 units usually look natural.
  • Avoid photos where thin objects such as hair or branches cross the frame edge.

Portrait blur from depth

Phone portrait modes blur backgrounds using depth from dual cameras or sensors. With a depth map, you can do the same afterwards. Set the focus depth to the subject (the nearest objects are 100 percent) and the tool blurs everything else in proportion to how far it is from that depth. Because the blur grows gradually, it looks more natural than a simple cut-out with a blurred background.

Using the depth map elsewhere

Designers use depth maps for displacement effects, 3D software uses them to create relief or to place fog, and video editors use them for depth-based colour grading. Download the PNG and import it as a depth or displacement map.

Limitations to expect

  • Glass, mirrors and water reflections confuse depth models.
  • Sky is often estimated as very far but sometimes inconsistent.
  • Thin objects may merge with the background.
  • Large camera movements reveal stretched pixels behind near objects, because the hidden background is not invented.

Privacy and performance

The model downloads once and is cached. All computation runs on your device with WebAssembly, so phones are slower than laptops, and nothing is uploaded.

Limits

Depth is an estimate and should not be used for measurements, safety decisions or anything that needs real distances.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages