Thursday, April 19, 2018

Grayscale height map to color gradient conversion.

A height map image, sometimes called a Digital Elevation Model DEM or Depth map, is a 2D grayscale image where brightness indicates a 3rd dimension. 

Labview's image display has a built in Gradient pallet to help enhance the contrast of the gray pixels.

It is nice to look at, but you can't save the image with the color pallet.

To create the color pallet, a new color image must be made.  The original grayscale values are used to control the Hue, Saturation and Lightness.

  • The original grayscale is squared and used as Hue.  
  • Original grayscale to the power of 4 is used as Saturation.  
  • And the original grayscale multiplied by 4 is used as Lightness.

The result is very close to the built in gradient pallet

Now there is a full RGB color image that can be saved, or sent over the network.


No comments:

Post a Comment