What Is a Depth Map?
Understand how a grayscale depth map represents estimated distance and how it can drive blur, parallax, fog, relighting and rough 3D effects.
Updated September 5, 2026
On this page
A depth map stores distance, not color
A depth map assigns a distance value to each pixel. It is often shown as a grayscale image so people can inspect it: one end of the scale represents nearby surfaces and the other represents distant surfaces.
The convention is not universal. Some tools display near objects as white and distant objects as black; others invert that relationship. Always check the documentation or sample a known region before using a map.
How a single-image model estimates depth
A normal photograph does not contain a measured distance for every pixel. A monocular depth model estimates structure from learned visual cues such as perspective, overlap, familiar object size, texture and focus. The result is usually relative depth: it can rank what appears nearer or farther without guaranteeing physical meters.
Stereo cameras, lidar and multi-view reconstruction can provide stronger geometric evidence. Do not treat a map inferred from one photo as a survey measurement.
What the grayscale values mean
An 8-bit map has 256 possible levels, which may be enough for a simple mask but can create visible steps in a strong blur or displacement effect. Higher precision formats preserve smoother transitions when the destination application supports them.
Before editing, note whether the file is linear or visually encoded and whether values are normalized per image. Two maps generated separately may not use identical scales.
Common uses
Synthetic depth of field
Use the map as a gradual mask so distant regions receive more blur than the subject. Feather transitions and protect fine foreground edges to avoid a cardboard cutout.
Parallax motion
Separate near and far regions, then move them at different speeds. Small movement is convincing; large movement exposes areas that were hidden in the original and must be reconstructed.
Fog and atmospheric perspective
Blend haze according to distance so far areas lose contrast gradually. This can add depth without rebuilding the scene in 3D.
Relighting and displacement
A depth estimate can guide rough shadows, surface displacement or 3D extrusion. It does not contain surface normals or hidden geometry, so expect only an approximation.
Where depth estimates fail
- mirrors, glass and reflective metal;
- smoke, hair and transparent fabric;
- repeated patterns and flat illustrations;
- unusual camera lenses or extreme crops;
- thin objects crossing several depth planes;
- scenes with ambiguous scale.
Edges deserve special attention. A halo in the map can transfer directly into blur, fog or parallax artifacts.
A practical workflow
- Generate the depth map from the largest clean source available.
- Confirm whether light means near or far.
- Inspect major objects and narrow edges.
- Correct obvious regions with a soft brush or selection.
- Apply the effect at a restrained strength.
- Review the result at full size and during motion.
- Keep both the source and edited map for later adjustment.
Depth map versus subject mask
A subject mask answers a category question: keep this object and remove the rest. A depth map represents a continuous spatial relationship. Thresholding a depth map can produce a rough near/far selection, but it may split a subject whose parts sit at different distances.
Use a segmentation mask for precise object isolation and a depth map for effects that should change gradually through space.