terrain-rgb-height
v0.0.3
Published
Converts Mapbox's Terrain-RGB PNG tiles to 16 bit greyscale PNG heightmaps.
Downloads
2
Readme
terrain-rgb-height
Converts Mapbox's Terrain-RGB PNG tiles to 16 bit greyscale PNG heightmaps. See here for an online demo and here for an example use case of importing 16 bit PNGs into Unreal Engine 4.
Installation
npm install terrain-rgb-height
Examples
var converter = require('terrain-rgb-height');
var options = {
inputFilePath: '/path/to/my/terrain-rgb-tile.png',
outputFilePath: '/path/to/output/16bit.png'
};
converter.convert(options, function() {
console.log("Finished.");
});
There is an option to scale the 16 bit pixels from 0 to 65535:
var converter = require('terrain-rgb-height');
var options = {
inputFilePath: '/path/to/my/terrain-rgb-tile.png',
outputFilePath: '/path/to/output/16bit.png',
scaleValues: true
};
converter.convert(options, function() {
console.log("Finished.");
});