Color Height Mapping

After looking at cookbook/un-flatland/unicam I started to think about a suitable height map color scheme. I know some prefer a grayscale, and that is ok, but I wanted to explore colors. I wanted a way I could use a math algorithm on an elevation value, and set a color. Yes, it could be a table look-up with ranges, but here I generated a 17 x 16 grid of colors, where I go from 0x00ff00, increasing the red component and reducing the green, to 0xff0000, then one extra 17th line where the red is reduced. This give me 272 colors to use, although the last at least 4 are too close to black, so say 268 colors or so, all in the red/green range.

Further web searching led me to MANY interesting images, like this one http://serc.carleton.edu/images/eslabs/corals/ocean_depth_colorscale.jpg which triggers the idea that maybe the scale should not be so strictly 'linear', but more 'exponential' due the the fact that the majority of the world is less that about 5,000 meters... and here http://www.theodora.com/maps/new/world_maps_2.html, and just so many others... Seemingly each with their 'own' color mapping scheme...

20131227: I have now 'played' with the neat table from unicam. Coded a quick DEM30 C++ loader, and loaded the 33 GTOPO30 DEM files, all except ANTARCPS, which is a little different. And wrote each out to a BMP file of the same width, height as the DEM. Looks nice... But nothing is cast in stone, and can be changed with a few strokes of the pen ;=))

Actually they are not 'really' DEM files, in that their format is more like that of a HGT file. They have no A and B records, but are a simple set of 16-bit integers, in Motorola format, row by row, with no file header, but do have a separatate .HDR file which gives them their credentials. It was 'fun' sorting through LOTS of very 'faulty' documentaion to be able to output a good image. A sample of E020N40 is shown below - click image to load full size... to me it is absolute magic at full size!

E020N40 DEM as BMP, then converted (by im) to PNG

The next bit of 'fun' will be to try to 'reduce' the width, height of the output by averaging in some way the color height map I build... feels interesting... but off for a big lunch tomorrow so will not get much computer time.

checked by tidy  Valid HTML 4.01 Transitional