IFS Fractals

Author: Greg Paperin.

Iterated Function Systems

Iterated Function Systems (IFS) is a widely known class of fractals that are self-similar by construction. The fractals are constructed by creating copies of a geometrical object that are transformed by transformation functions (thus, “function systems”). The results of the transformation are combined with the original image and then transformed again and again (thus, “iterated”). The fractal is the limit object arising as the result of the IFS. Interestingly, the result depends only on the IFS itself and not on the initial object. Thus, when rendering IFS fractals, a point is taken as the initial object for simplicity.

Although different kinds of transformations can be used in IFS, affine transformations are used most commonly. An affine transformation of a point (x, y) to the point (xn+1, yn+1) can be described as

xn+1 = a·xn + b·yn + e
yn+1 = c·xn + d·yn + f

Thus, a transformation can be described as a 6-tuple (a, b, c, d, e, f). An IFS is then a collection of r transformations where r >= 2:

T1: (a1, b1, c1, d1, e1, f1, P1)
T2: (a2, b2, c2, d2, e2, f2, P2)

Tr: (ar, br, cr, dr, er, fr, Pr)

Note the additional parameter Pi for each transformation. This is the transformation probability. When the IFS is executed, it normally begins with a random point p0 in the plain. A transformation Tn is then randomly chosen with the probability Pn. The resulting point p1 = Tn(p0) is calculated and rendered. Then the next transformation is chosen randomly with a probability specified by the transformation parameters. The next point is obtained using this transformation and rendered. This process is then continued ad infinitum (for an ideal fractal) or until the required saturation is reached (for a rendering approximation).

How to use the renderer

You need Java version 1.6 or later in order to run the renderer.
A number of well known IFS fractals are built into the renderer. Barnsley’s fern may be the most famous of the IFS family, but some other very famous fractals, such the Sierpinski triangle can also be obtained using this method.

  • Preset: Choose a predefined fractal from the preset list. The transformation table will be immediately populated with the corresponding values (warning: all previous values will be discarded). You need to hit the Apply button to apply the IFS specified in the table to the rendering engine.
  • Transformation table: In this table you can specify the affine transformations for the IFS. You can edit any of the transformation parameters at will. Only enabled transformations are actually used. Note that the P-values of all enabled transformations must sum up to 1.0.
  • Multi-colour: When disabled, all points are rendered using the same colour. When enabled, the colour of a point depends on the transformation that was used to obtain that point.
  • Apply: Hit this button in order to (re-)initialise the rendering engine with the IFS specified in the transformation table.
  • Start: Hit this button to begin rendering the IFS.
  • Stop: Hit this button to stop the rendering process.
  • Clear: Hit this button to clear the canvas.
  • About: Hit this button to display the developer credits.

Things to try

  1. Check out the fractal summary page and the fractals and scale tutorial to gain a better understanding of the theory behind this fractal image renderer.
  2. Play around with the predefined IFSs.
  3. Learn about how different geometric operations such as rotation, scaling, movement and others that can be represented using matrices (the Wikipedia article on transformation matrices [http://en.wikipedia.org/wiki/Transformation_matrix] and other links below may be helpful).
    Using the multi-colour function, try to understand how the predefined IFS work.
  4. Try to modify the predefined IFS to obtain new but similar images.
  5. Try creating your own new IFS fractal.

Download source code

You can download the Java source code for the renderer as a ZIP archive (50 KByte).

Links and references

Demo screenshot