Midpoint Displacement

One way to generate an artificial terrain is by the Midpoint Displacement method. Divide a grid into regions, and change the altitude of the corners of each region by a random amount. Divide each of those regions into smaller regions, and change their altitude by a random, but smaller, amount. Repeat this process until the terrain is as detailed as desired.

These images show 9 stages of this procedure.

The amount of displacement at each stage can be varied, as shown here. Larger changes lead to a less-smooth surface.

Although the terrain is colored by its altitude, other color maps can produce realistic terrain - for instance, green in the lowlands, browns for mid-altitude, and white for snowcapped peaks. Elevations below a certain level can be set to a constant value and colored, say, blue, to generate lakes and oceans. The data set can also be interpreted as a two dimensional grid of intensities - higher "altitudes" corresponding to greater densities. This grid can then be used to represent clouds.