Heightmap Conversion with GDAL

Last modified

6 July 2018
16 bit Mt Ruapehu

Mt Ruapehu modelled from a 16 bit grayscale heightmap

8 bit Mt Ruapehu

Mt Ruapehu modelled from an 8 bit grayscale heightmap.

Introduction

GDAL (Geospatial Data Abstraction Library) can convert heightmaps into a format usable by 3d modelling software. Unlike QGIS it is not limited to 256 shades of gray (8 bit grayscale). Compare the two images above and note how much better the first model is because it was made using a heightmap with 65535 shades of grey.

Method

Navigate to the directory containing your source file.

Obtain the MIN MAX heights by typing:-

gdalinfo -mm "source.tiff"

Then use those values to replace MIN MAX below:-

gdal_translate -of PNG -ot UInt16 -scale MIN MAX 0 65535 "source" "destination.png"

Source

How can I create a 16bit PNG heightmap in QGIS?

Add new comment

Your email will be private. It is used to notify you of replies to your comment.

Plain text

  • No HTML tags allowed.