Depth maps and heightmaps, explained
A depth map is a picture of shape: each pixel says how near or how high that point is. It is the bridge between photos, 3D models, CNC machines and printed reliefs — and AI has made it easy to get one from any photo.
What a depth map is
A depth map is a greyscale image in which brightness stands for distance. By the usual convention white is near and black is far. Viewed from straight above, distance and height are the same thing, so a depth map of a relief is also its heightmap: white is high, black is low.
That makes it a very compact way to describe a surface. A CNC router can carve it, a printer can print it as a relief, Blender can push a flat plane up and down with it, and image tools can use it to understand the shape of a scene.
Three ways to get one
| Source | Accuracy | Tool |
|---|---|---|
| A photo, through an AI depth model | Estimated, relative | AI photo to 3D relief |
| A 3D model (STL, 3MF, OBJ, GLB) | Exact | STL to depth map |
| Real terrain | Measured elevation data | Map to STL |
Blender can also render one: enable the Z or Mist pass of a scene and save it as a greyscale image. And because a depth map is just a picture, you can paint one by hand.
8-bit or 16-bit?
An 8-bit image has 256 grey levels. Spread over a 25 mm tall model, each level is about 0.1 mm — enough to see as steps on a carved or printed surface. A 16-bit image has 65,536 levels, so the steps vanish. Use 16-bit for CNC and large reliefs; 8-bit is fine for small prints, especially with a little smoothing, and it opens in every program.
A 16-bit depth map saved again from an ordinary image editor or a screenshot tool often comes back as 8-bit. Keep the original file, and smooth 8-bit maps slightly before making a relief.
What you can do with it
- Print a relief: depth map to STL turns any depth map into a closed, printable plaque or a cut-out shape.
- Carve it on a CNC: import the PNG as a 3D texture or component in your CAM software.
- Engrave it with a laser: many laser programs have a 3D or greyscale mode that burns deeper where the image is darker or lighter.
- Displace a surface in Blender for terrain, embossing or a parallax background.
- Guide an AI image generator with the exact shape of a scene.
A depth map is not a lithophane. A lithophane uses brightness on purpose, because it is lit from behind and thickness controls how much light passes; for that, use the lithophane maker.
Tips for good results
- Separate the subject: a clear gap in depth between subject and background makes cut-outs and clean plaques easy.
- Compress big jumps: a thin relief cannot hold a 1 m drop to the background. Bas-relief compression ("Enhance detail") keeps the fine detail and shrinks the jump.
- Smooth before you print: a light blur removes speckle that would print as roughness.
- Light from the side: reliefs read by shadow — a raking light shows them at their best.
Frequently asked questions
Is a depth map the same as a heightmap?
Almost. A depth map measures distance from a camera (white = near), a heightmap measures height above a base (white = high). Seen from straight above they are the same picture, and most software treats them the same way.
Why does my photo look wrong as a heightmap?
Because brightness is not depth. A white shirt is not closer than a dark face, but a brightness-based heightmap raises it. An AI depth model estimates real distance instead, which is why it gives far more believable reliefs from photos.
Which AI models make depth maps?
Open models such as Depth Anything, MiDaS, ZoeDepth and Marigold. They predict relative depth — what is in front of what — rather than exact distances in millimetres, which is exactly what a relief needs.
Can I edit a depth map?
Yes. It is an ordinary greyscale image: paint it lighter to raise areas, darker to lower them, blur it to smooth the surface. Work in 16-bit in the editor if you can to avoid terracing.