Typically, tangent space normal maps are generated from a simple height maps: Greyscale images where
0.0 denotes the lowest possible height, and
1.0 indicates the highest possible height. There are multiple algorithms that are capable of generating normal vectors from height maps, but the majority of them work from the same basic principle: For a given pixel with value
h at location
(x, y) in an image, the neighbouring pixel values at
(x - 1, y),
(x - 1, y - 1),
(x + 1, y),
(x + 1, y + 1) are compared with
h in order to determine the
slope between the height values. As an example, the
Prewitt (3x3) operator when used from the
gimp-normalmap plugin will produce the following map from a given greyscale height map: