Skip to content

Converts Mapbox's Terrain-RGB PNG tiles to 16 bit greyscale PNGs

License

Notifications You must be signed in to change notification settings

colkassad/terrain-rgb-height

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terrain-rgb-height

Converts Mapbox's Terrain-RGB PNG tiles to 16 bit greyscale PNG heightmaps. See my demo map repository for an example implementation.

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.");
});

About

Converts Mapbox's Terrain-RGB PNG tiles to 16 bit greyscale PNGs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published