Macintosh IFS manual

Written by Paul Bourke
May 1990


The following describes iterated function systems, a particular implementation on the Macintosh, and presents some examples.

One of the many ways of describing the affine transformations for iterated functions systems (IFS) is as follows:

x = r cos(theta) x + s sin(phi) y + h
y = -r sin(theta) x + s cos(phi) y + k

Generally there are a number of these mappings (different values of r, s, theta, phi, h, k) which are chosen at random at each iteration.

How does the program work

The fundamental iterative process involves replacing rectangles with a series of rectangles called the generator. The rectangles are replaced by a suitably scaled, translated, and rotated version of the generator.

For example consider the generator below

It consists of three rectangles, each with its own center, dimensions and rotation angle. The initial conditions usually consist of a single square, the first iteration then consists of replacing this square by a suitably positioned, scaled and rotated version of the above generator. The result would just be the generator above. The next iteration involves replacing each of the rectangles in the current system by suitabled positioned, scaled, and rotated versions of the generator resulting in the following

The next iteration replaces each rectangle above again by the initial generator as shown below

and so on, three iterations later

IFS allows the user to explore the result of applying different generators. The generator rectangles can be created, shifted, scaled, and rotated by the handles on each rectangle shown below.

The user may iterate forward or in reverse, colour the borders, interior, or background.

A library of interesting generators is provided for initial experimentation. Generators created by users may be saved in files and recalled at a later time.

Images so created may be copied from IFS and pasted into a more standard drawing package for incorporation into a document and printing.

Hopalong or "The Chaos Game"

A technique exists by which the resulting form after an infinite number of iterations can be derived. This is a function of the form

This gives a series of (x,y) points all which lie on the result of an infinite IFS. Although it still takes an infinite number of terms in this series to form the result the appearance can be readily appreciated after a modest number of terms (10000 say).

Note that with both methods it is possible to create the image at any scale. In many but not all cases zoomed in examples will be exhibit self similarity at all scales.


Data reduction for model files. If a generator can be found for a complex image then storing the generator and the rules of production results in a great deal of data reduction. For example the weed in the examples above might eventually contain over 2000 rectangles but is completely specified by the characteristics of 3 rectangles, only 5 numbers, center (cx,cy), scale (sx,sy), and angle

Note: it is not necessarily trivial to derive a rectangular generator for an arbitrary form, although it is possible to create a polygonal generator for any form. The following shows a maple leaf generated using the IFS program.

Some other IFS examples of plant-like structures are shown below


Demko, S., Hodges, L., and Naylor B
Construction of Fractal Objects with Iterated Function Systems
Computer Graphics 19, 3, July 1985, Pages 271-278

Barnsley, M.
Fractals Everywhere
Academic press, 1988

Barnsley, F., and Sloan, A.D.
A Better Way to Compress Images
Byte Magazine, January 1988, Pages 215-222

Oppenheimer, P.E.
Real Time Design and Animation of Fractal Plants and Trees
Computer Graphics, 20, 4, 1986

Reghbati, H.K.
An Overview of Data Compression Techniques
Computer, 14, 4, 1981, Pages 71-76

Gallery of Randomly Generated IFS

Created by Paul Bourke
March 1998

Colour examples

The following images are a selection from an infinite set of Random Iterated Function Systems (IFS) of the form

xn+1 = a xn + b yn + c

yn+1 = d xn + e yn + f

The image is formed by drawing a point at each iteration at the position (xi,yi).

For the mapping to contractive the following must all be true.

a2 + d2 < 1

b2 + e2 < 1

a2 + b2 + d2 + e2 < 1 + (ae - db)2

For any particular image there are 4 different sets of values for (a,b,c,d,e,f) all on the interval [-1,1]. At each iteration step one of the sets is chosen at random to form the next term in the sequence (series).

The results fall into the following broad classes of images

Infinite or constant, these can't be drawn and are specifically tested for and ignored by the software. (These are not affine mappings)
Single blobs
Often with outgoing rays.

Interesting, attractive, and often organic forms.

The third "interesting" category can be further classified as follows

Things made up of intersecting spikes
They often look like Kanji text.

Things that look like
blobs of seaweed on the beach.