Note: This forum is merely an archive. It is no longer possible to register or post. - StackOverflow
New Ace of Spades Forums:

Heightmap Colorer

Having problems creating a map? Ask around in here.

Heightmap Colorer

Postby Yourself » Mon Jan 02, 2012 1:26 am


This tool is a successor to my previous browser based heightmap colorer and shadow generator.

This new version comes in a compiled exe file. It was written in python 2.7 and packaged with py2exe. The source code is included with the download.

The tool takes three command line parameters: the heightmap image, the gradient image, and the angle of the sun in degrees.

Code: Select all
heightmap.exe height.png gradient.png 30

The program outputs two image files: color.png and shadow.png

The program colors the heightmap based on the gradient image. For every pixel of the heightmap, the program determines the color at the coordinate (x,y) based on the color at the gradient coordinate (floor((r+g+b)/3),0) where r, g, and b are the color channels of the heightmap image at (x,y).

Any of the parameters can be left out and the default values will be used. For example

Code: Select all
heightmap.exe myheightmap.png

is a valid input.
I am the sword in the darkness. I am the watcher on the walls. I am the fire that burns against the cold, the light that brings the dawn, the horn that wakes the sleepers, the shield that guards the realms of men.
User avatar
Posts: 28
Joined: Mon Dec 26, 2011 7:27 pm

Re: Heightmap Colorer

Postby PXYC » Sun Jan 29, 2012 6:07 pm

Very nice, I love the tools and scripts that you make. *So useful*

<+laserlamp> lil b is my fav
User avatar
Local Mod
Posts: 1068
Joined: Wed Dec 14, 2011 2:52 am
Location: Near Philadelphia, PA

Return to Mapping Help

Who is online

Users browsing this forum: No registered users and 1 guest