Plasma fractals

A scientific name for this type of fractals would be: Random Midpoint Displacement Fractals. In fractint they are called plasma; another popular name for them is: fractal clouds.

Here is a simplified explanation of the (recursive / iterative) algorithm:

initialisation:
generate random values for 4 corners of a rectangle A,B,C,D

iteration:
divide the rectangle in 4 smaller ones, calculate values for the 5 new points (midpoints on the sides and center): those values are a SUM (mean value of the endpoints defining the midpoint) PLUS (pos. or neg. random value proportional to size of segment)

stop criteria:
the previous step is repeated until the size of the subrectangles will be smaller than one pixel.


The result is "best" when the initial rectangle is as close as possible to a square (the clouds are almost round).

This fractal type has one parameter, the coefficient of the random part that is added to every midpoint. Fractint calls it the grainyness: if this values is small, the plasma will be a smooth surface; if it is greater, the resulting plasme will be rougher.
The random part must become smaller when the sub-rectangles become smaller, otherwise the result will look just like a random-dot surface.
The result also looks better when the random value may be a positive or negative number; if the random part is always positive, the plasma is comparable to a surface that has only mountains and no hills.

Example program in Pascal: plasma.pas

Fractint Applications of plasma fractals:

Another application of plasma fractals, not yet explored by fractint, would be to use them as background images for stereograms. The problem is: stereogram images are best when the background image has continuous vertical stripes! Therefore, I extended the Random Midpoint Displacement Algorithm to generate tiles (periodic in both dimensions):

First, I generate values for the points A,B,C,D, and let the originial algorithm fill the rectangle [A,B,D,C].
Then I copy the whole segment [A,B] to [A',B'] and fill the rectangle [C,D,B',A']; as a result, the transition on the segment [C,D] is seamless; and: if [A,B,D,C] would be copied to the right of [C,D,B',A'], then the transition on [A',B'] is seamless too.
Next, I copy the segment [A,C] to [A",C"] and fill the rectangle [B,D,C",A"].
For the final step, I copy two segments: [C,A'] to [C",A'"] and [B,A"] to [B',A'"]; and fill the last remaining rectangle.

The result is a fractal cloud tile [A,A",A'",A'] !

My first idea was to simply make mirror copies of [A,B,D,C] to the other 3 rectangles, but the resulting symetry was disturbing.

I used a variant of this algorithm to generate a background for a stereogram: atom.jpg.


Created: 1997-02-17
Your comments are welcome! Mail to Patrick Hahn (phahn@vo.lu)
Homepage: http://www2.vo.lu/homepages/phahn/default.htm