16 Bit PNG Heightmap Generator

Aim

The aim of this project is to generate 16 bit heightmap data for use in software such as Unreal Engine 5

High quality height data is available from Mapzen's global elevation service.

How to Export

Enter your latitude/longitude values here

Using the map at the top of the screen, choose a location. You can also manually type in a latitude and longitude.

The orange rectangle shows the size of the exported image, and what will be included.

The size of the exported area depends on the output zoom and the output size in pixels.

After clicking 'Generate' a 16 bit PNG should await you.

Explanation of different options

LatitudeThe Latitude at the centre of the image
LongitudeThe Longitude at the centre of the image
ZoomThe zoom level in the preview
Output ZoomThe zoom level to use for the output
Map Preview TypeThe tiles to use in the preview at the top of the page
Output Width (px)The output width of the entire image in pixels
Output Height (px)The output height of the entire image in pixels
Default UE5 SizesA preset list of useful sizes for generating Unreal Engine 5 terrain
Normalisation ModeThe normalisation mode to use. See below for more information
Norm FromOverrides the normlisation "from" parameter. Can be useful when low height data is funky, e.g. at the coast (just use 0)
Norm ToOverrides the normlisation "to" parameter

Top Tip: Copy & Paste

You can now copy and paste straight onto the page any lat/lng string. Acceptable formats include:

  • 03°04′33″S 37°21′12″E
  • 3.0674° S, 37.3556° E
  • -3.0674, 37.3556
The orange box shows the area that will be exported.

Output

The output will be a 16 bit grayscale PNG file with the gray levels representing the height of the ground at that location.

16 bits gives 216 levels of detail between the lowest and highest point. That's 65536 levels - enough to detail from sea level to the top of mount everest (8849m) in roughly 13cm intervals.

For comparison, 8 bit detail only give 28 levels of detail, which is only 256 levels!

The mapzen data is actually much more detailed than 16 bit (it has 24 bits of data, with a fidelity of about 4mm in the data itself, although the measurements are probably only accurate to 1m maximum)

Normalisation Options

When using the data for import into Unreal Engine 5, it can be useful to normalise the data so that you're using the full 16 bit range of the file.

None
Do not perform any normalisation. The pixel value represents the height in m (note that negative values will be 0)
Regular
Scale the height values in the data to 0 to 65536, making full use of all 16 bits of the file's range
Smart
Unfortunately, there are some errors in the Mapzen data that throw off the normalisation - 0 values or high values that skew the normalisation completely. Using this method, we take a 99.9% window of the data to get rid of outliers. However, if the actual max/min are within 1 standard deviation of the windowed max/min then we use the actual values to retain the min/max data.

Examples

Normalisation Mode None Regular Smart
Aizuwakamatsu
Without Source Error
Mt Fuji
With Source Error

Here is an example of an error in the source data:

FAQs

There is a weird artefact in my image - why is that? Unfortunately there are some errors in the source data - please check the 'Terrarium' preview type at the same zoom level and see if the artefacts are also present.
How do I use these images? You can find information how to use the 16 bit png images for landscapes on the Unreal Engine website
Why wouldn't I use the heightmapper website output? Unfortunately, because of the way it generates images, the output from heightmapper is 1) noisy, 2) only 8 bit, resulting in poor quality landscapes and jagged areas. In 8 bit, a 1000m tall mountain would have jagged edges every 4m in height.