Heightmap to STL Converter

Convert 2D grayscale heightmaps and DEM maps into solid 3D reliefs.

3D Studio Viewport
Triangles: 0Vertices: 0

Heightmap to STL Converter

Image to mesh & creative 3D printing tools

Model Width80 mm
Base Thickness1.2 mm
Relief Height / Depth4 mm
Watertight STL output · Ready for slicing
⚡
Instant Local WASM
Zero cloud wait, processed in RAM
🛡️
Watertight STL
Slicer-ready manifold output
🖨️
Slicer Tested
Bambu, Orca, Prusa & Cura
🔒
100% Private & Free
No login or subscription needed
Verified for Bambu, Orca, Prusa & Cura
Tutorial & In-Depth Technical Guide

Heightmap to STL: Converting Grayscale Terrain and DEM Maps into 3D Reliefs

Convert 2D grayscale heightmaps, GIS elevation data, and DEM files into solid 3D printable STL terrain models. Calibrate base elevation and vertical exaggeration.

Converting two-dimensional raster elevation data into tactile 3D topographical terrain models is an indispensable workflow for geologists, landscape architects, educational institutions, tabletop game terrain builders, and geographical hobbyists.

Whether using Digital Elevation Models (DEM) from the United States Geological Survey (USGS), satellite radar data from NASA’s Shuttle Radar Topography Mission (SRTM), or procedural heightmaps exported from terrain generators like World Machine and Gaea, turning a grayscale raster image into a clean, 3D printable STL mesh requires careful elevation scaling and boundary closure.

This tutorial provides step-by-step instructions for converting 2D heightmap graphics into solid, watertight 3D terrain meshes using the browser-based FreeConvert3D Studio.


The Mathematics of Digital Elevation Mapping

A heightmap is an 8-bit or 16-bit raster image where each pixel’s grayscale luminance encodes an absolute physical elevation:

Grayscale Luminance Level [0 to 255]
       │
       ▼  Elevation Transformation:  Z(x, y) = Base + (L / 255) * Vertical_Exaggeration
Physical Terrain Mesh ($X, Y, Z$)
  • Black Pixels ($L = 0$): Represent the lowest geographic datum (sea level, valley floors, or deep ocean trenches).
  • White Pixels ($L = 255$): Represent the highest mountain peaks or topographical plateaus.
  • Vertical Exaggeration: In natural planetary scales, mountain ranges appear surprisingly flat when scaled down to a 100 mm desktop print. To make mountain ridges physically recognizable and tactile, a vertical exaggeration multiplier between $1.5\times$ and $3.0\times$ is typically applied.

Key Parameters for 3D Printable Terrain

Configuration VariableRecommended ValueEngineering Purpose
Model Footprint Width100 mm to 200 mmScaled to fit comfortably on standard 3D printer build plates
Baseplate Floor Thickness2.0 mm to 3.0 mmPrevents corners from curling or warping off the build plate during cooling
Maximum Relief Elevation10.0 mm to 25.0 mmProvides clear tactile ridges without exceeding maximum layer print times
Sampling Mesh Grid256x256 to 512x512Balances fine topographical detail against browser memory and slicer slicing time
   Mountain Peak (White: Z = 15.0 mm)
         /        /     Ridge
       /      /  ────/──────/──────────── Sea Level Datum (Black: Z = 2.0 mm)
  ══════════════════════════ Solid Baseplate (Floor: Z = 0.0 mm)

Step-by-Step Tutorial: Generating an STL Terrain Model

  1. Obtain High-Resolution Elevation Data:
    • Download free DEM grayscale tiles from public GIS repositories such as the USGS EarthExplorer or OpenTopography.
    • Crop your geographic area of interest into a square or rectangular PNG graphic.
  2. Import into FreeConvert3D:
  3. Configure Physical Elevation:
    • Mode: Select Relief.
    • Model Width: Set your desired physical display size (e.g. 120.0 mm).
    • Base Thickness: Set to 2.0 mm to create a stable, non-warping foundation floor.
    • Relief Height: Adjust the vertical relief height (e.g. 12.0 mm) to achieve the desired vertical exaggeration.
  4. Generate Watertight Solid: The system automatically stitches four vertical side walls along the geographic perimeter and seals the bottom with a flat planar floor.
  5. Download Binary STL: Save the finalized mesh ready for immediate slicing.

If you are working with photographic portraits or family pictures instead of topographic maps, read our guide on 3D Printed Lithophanes.


To capture subtle geological gullies, riverbeds, and ridgelines without excessive print times:

  • Layer Height: Use 0.12 mm layer height for the top terrain section. If your slicer supports Adaptive Layer Height, enable it to print the flat baseplate at 0.28 mm and automatically drop down to 0.08 mm along steep mountain ridges.
  • Infill: 10% to 15% using Gyroid infill to support broad horizontal plateaus.
  • Top Solid Layers: Minimum of 5 solid layers (1.0 mm) to prevent pillaring or sagging over valleys.
  • Orientation: Always print flat on the build plate with the flat base facing down. Never print terrain vertically.

Frequently Asked Questions

Why does my terrain model have jagged horizontal stair steps?

If you source an 8-bit grayscale image, there are only 256 distinct discrete height steps. Over a 25 mm tall mountain relief, each gray value step creates an abrupt $0.1\text{ mm}$ vertical shelf. To eliminate stepping, apply a subtle Gaussian blur ($1\text{px} - 2\text{px}$) to the image in an editor before importing to smoothly interpolate between elevations.

Can I convert lunar or Martian elevation maps?

Yes. NASA publishes high-resolution LOLA (Lunar Orbiter Laser Altimeter) and MOLA (Mars Orbiter Laser Altimeter) elevation maps in standard grayscale formats. You can import these images directly into FreeConvert3D to print scale replicas of lunar craters and Olympus Mons.

Is the conversion completely private?

Yes. All canvas pixel scanning, elevation matrix sampling, and Three.js 3D mesh generation take place entirely inside your local browser memory. No geographic data is transmitted to external servers.

Get Started with FreeConvert3D

Free online 3D file converter and 2D image to STL tool. Convert PNG, JPG, STEP, OBJ, and 3MF to 3D printable files directly in your browser with zero upload wait.

Try FreeConvert3D Free Browse More Guides