Heightmap to STL: how brightness becomes depth
Every PNG to STL converter works the same way underneath, whether it calls it a heightmap, a relief, an extrusion or an emboss. This page explains that mechanism plainly, so you can tell in advance whether your image will convert well — and fix it when it does not.
What a heightmap actually is
A heightmap is an image where each pixel stores a single number: how high that spot sits. Most often that number is the pixel's brightness, normalised into the 0–1 range. When a converter builds your mesh, it does something geometrically simple — it treats every pixel as a column and extrudes it to the height that pixel specifies.
White is treated as maximum height, black as zero, and everything in between scales proportionally. That is the entire idea. There is no depth inference, no hidden surface, no geometry behind the image plane.
| Pixel | Brightness | Resulting height |
|---|---|---|
| Pure white | 1.00 | Full relief height above the base |
| Mid grey | 0.50 | Roughly half the relief height |
| Pure black | 0.00 | Flat, level with the base plate |
Why a photo cannot become a 3D object
This is the single most common misunderstanding around image-to-STL tools, and it is worth being blunt about it. A photograph is one projection of a three-dimensional scene. The camera records what is visible along one line of sight for every pixel. The sides of the object, its back and its underside are simply not in the data.
So when a tool advertises turning a photo into a 3D model, one of two things is happening. Either it is doing a heightmap, which is what this site does — a raised relief on a flat back. Or it is an AI reconstruction system that is guessing at the hidden geometry, producing a watertight but invented shape, usually for a fee in credits. Both are legitimate tools. They are just not the same tool, and confusing them is the reason people download a model and feel disappointed by it.
If you genuinely need a freestanding 3D object from something physical, the right approach is photogrammetry — dozens of overlapping photos taken from different angles, so the software can triangulate real depth. Or, for stylised figurines, a dedicated AI mesh generator. Neither is a heightmap converter, and this page will not pretend otherwise.
Relief vs lithophane: the same data, two very different results
Both are produced from a heightmap, but they are read in completely different ways, and that changes the numbers you need.
| Relief | Lithophane | |
|---|---|---|
| How you read it | Normal light, by shadow | Light from behind, by transmission |
| Thickness curve | Linear, wide range | Exponential, narrow range |
| Typical range | 1.5 mm base + 2–4 mm relief | 0.6–0.8 mm to 3.0–3.2 mm total |
| Print orientation | Flat, face up | Vertical, on edge |
| Infill | 15–20% | 100% or high wall count |
| On a shelf it looks like | The image | A blank white tile |
The reason lithophanes need an exponential curve is physical: light does not fade linearly through plastic. It drops off roughly by half per millimetre in white PLA, so equal steps in thickness produce very unequal steps in brightness. A linear mapping that looks fine on a relief will look flat and lifeless when backlit.
Which images convert well, and which fight you
Convert cleanly
- High-contrast logos and icons
- Line art, icons and pixel art
- Coin and medallion designs
- Portrait silhouettes
- Text on a clean background
Convert poorly
- Low-contrast, washed-out photos
- Images full of similar mid-tones
- Heavy JPEG compression artifacts
- Busy or graduated backgrounds
- Very fine detail at small print size
The common thread is tonal range. A good source image uses the full 0–255 brightness range, so the height field has something to work with. A flat grey photo has no range to exploit, which is why it converts into a flat grey slab no matter what settings you use.
Every control, explained
Relief height
How far the brightest pixels rise above the base, in mm. 1–2 mm reads cleanly for logos and text; 3–6 mm suits photographic portraits and landscapes. Beyond about 8 mm the slopes get steep and the outer edge starts to overhang.
Base plate
The solid slab under the relief. None gives a floating, flat-bottomed piece; thin (1.5 mm) is a good default; thick (3 mm) adds rigidity and self-support so a tall relief does not rock or snap off the bed.
Edge radius
The rounded slope between the base and the raised surface, computed from a true signed distance field. A 0.5 mm radius removes the razor-sharp cliff that raw heightmap output produces, which is otherwise the first thing to crack during printing.
Contrast
A multiplier on the brightness-to-height difference. Raise it to push mid-tones apart when a photo looks washed out; lower it toward zero when you want a shallow, gentle relief.
Invert
Reverses the mapping so dark pixels rise instead of bright ones. Essential for the very common case of a dark logo on a light background, where the default mapping would make the background the tallest part and sink your logo into it.
Smoothing
Blur passes over the height field before meshing. Raw conversion turns each sharp brightness jump into a cliff and single-pixel noise into a spike your slicer has to support. Keep it low for logos and lettering, raise it for portraits and organic shapes.
Edge subdivision
Segments per edge cell. Higher values round the outer boundary more smoothly at the cost of a larger mesh. 8 is a good default; 1 gives a hard chamfer for CNC toolpath work.
Print settings that actually work
A perfect STL still prints badly under the wrong settings. Here is the short version for FDM printers.
| Project | Layer height | Infill | Orientation | Material |
|---|---|---|---|---|
| Relief, FDM | 0.2 mm | 15–20% | Face-up, no supports | Any PLA/PETG |
| Relief, best finish | 0.12–0.16 mm | 20% | Face-up, no supports | Any PLA |
| Lithophane | 0.08–0.12 mm | 100% or high walls | Vertical, on edge | White or natural PLA |
| CNC relief | n/a | n/a | 0.5 mm radius | Hard edge, 1 subdivision |
- For lithophanes, place the light 20–50 mm behind the print behind a diffuser. A bare LED touching the back produces hot spots that hide detail.
- Print lithophanes vertically so layer lines run across the image rather than stacking through it.
- Drop to 30–40 mm/s with full cooling on lithophanes so thin walls solidify cleanly.
- Avoid black, silk, wood, metal-filled and ABS filaments for lithophanes — they block light and destroy the effect.
- Bambu Studio and OrcaSlicer ship a dedicated lithophane profile that already sets vertical orientation and concentric perimeters. Start there if you have them.
Frequently asked questions
Is a heightmap the same as a 3D scan?
No. A heightmap stores a single height value per pixel, so it describes a surface with a known base — nothing exists below or behind it. A scan or photogrammetry model stores a full 3D volume with real sides, back and underside. Heightmaps are the right choice for flat-backed reliefs, plaques and lithophanes; scans are the right choice for objects you want to hold in your hand.
Why does my converted model have tiny spikes?
Because single-pixel noise in the source image becomes a one-voxel spike that your slicer tries to support. Increase Smoothing to blur the height field before meshing, raise Contrast if the noise sits in the mid-tones, and make sure the source image is not a heavy JPEG with compression artifacts around edges.
Why do two areas of different colour come out at the same height?
Height comes from luminance only. A red shirt and a green wall with the same perceived brightness map to the same Z value, because the geometry pipeline deliberately discards hue. If two things need to separate, differentiate them by brightness in the source image, or use Colour mapping to keep their colour in the 3MF export.
How do I make a logo stand out properly?
Give yourself a transparent-background PNG, turn on Invert if the logo is darker than its background, keep Smoothing at 0–1 so the edges stay crisp, and set Relief height around 1.5 mm with a solid base. Logos are the case where aggressive smoothing and high contrast both actively hurt the result.
What resolution should my source image be?
At least 1000 px on the long edge, and larger if you plan to print big — roughly 250–400 px across the finished width is the useful range before detail turns into noise. A huge image is not automatically better: it inflates triangle count and slicing time without adding readable detail at normal print sizes.
Heightmaps beyond 3D printing
The same idea drives plenty of other technology. Game engines build large terrain meshes from heightmaps. Real-time graphics use a related normal map to fake surface detail without any geometry at all. CNC routers and laser engravers derive their toolpaths from height data. Once you see that brightness-to-height is a general technique for turning 2D into 3D, it becomes obvious why the format is worth understanding rather than just clicking convert.
Ready to turn your own image into a heightmap?
Everything runs in your browser. Nothing is uploaded, nothing is watermarked, and the export is watertight.
Open the converter