terrain-rgb-slope

Converts 32 bit RGB-encoded height map PNGs to 16 bit PNGs depicting slope

Usage no npm install needed!

<script type="module">
  import terrainRgbSlope from 'https://cdn.skypack.dev/terrain-rgb-slope';
</script>

README

terrain-rgb-slope

Converts Mapbox's Terrain-RGB PNG tiles to 16 bit greyscale PNGs depicting integer slope percentage. See here for an online demo.

Installation

npm install terrain-rgb-slope

Examples

var converter = require('terrain-rgb-slope');

var options = {
  inputFilePath: '/path/to/my/terrain-rgb-tile.png',
  outputFilePath: '/path/to/output/16bit-slope.png'
};

converter.convertToSlope(options, function() {
  console.log("Finished.");
});