Skip to content

Instantly share code, notes, and snippets.

@cquest
Last active July 5, 2022 06:30
Show Gist options
  • Save cquest/8179870 to your computer and use it in GitHub Desktop.
Save cquest/8179870 to your computer and use it in GitHub Desktop.
transparent hillshade cooking guide using gdal
Ingredients:
- a decent DEM
- gdal
- some computer
# compute grayscale hillshade using gdaldem
gdaldem hillshade -compute_edges you_dem_file hillshade.tif
# in another bowl, prepare the following shade.ramp file
0 0 0 0 255
32 0 0 0 240
64 0 0 0 180
96 0 0 0 120
220 0 0 0 0
221 255 255 255 0
255 255 255 255 192
#other option (smoother shades)
0 0 0 0 255
220 0 0 0 0
221 255 255 255 0
255 255 255 255 192
#and third one if you want only shades
0 0 0 0 255
220 0 0 0 0
255 0 0 0 0
# stir together using gdaldem color-relief
gdaldem color-relief hillshade.tif -alpha shade.ramp hillshade-overlay.tif
@StyXman
Copy link

StyXman commented Aug 19, 2019

It would be awesome if you could include some output examples. Thanks for the info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment