At the start of the 1980s, the late mathematician Benoît Mandelbrot made a discovery that was to capture the public imagination in a way that nobody – including himself – could have predicted. Encoded within a simple mathematical construct he found an infinity of detail: rich, enormously varied, and possessing previously unseen properties of fractal self-similarity. The computer visualisation of this construct – known as the Mandelbrot set (Fig 1, below) – sparked international interest and made fractals into some of the most iconic images of the era. At the time, Mandelbrot’s work served as sort of poster child, not only for the rapidly emerging field of chaos theory, but also in computer-aided mathematics, engineering and computer graphics. Its beauty and intrinsic complexity made it the subject of popular debate, grounded in maths but also extending into more foreign territories such as modern art. Today, Mandelbrot’s work remains enormously popular, the dramatic rise in consumer computing power having lead to fractal renderers being implemented across a plethora of systems and platforms. Their qualities are especially favoured by students of computer graphics, many of whom consider synthesizing an image of the Mandelbrot set almost as a rite of passage.
Fig 1: A zoomed-in portion of the Mandelbrot set.
Practically speaking, a basic fractal renderer is almost absurdly trivial to implement, relying as it does on a two-line, iterated function. The premise is simple. The x and y axes on a computer screen represent the real and imaginary axes on the complex plane. For each pixel, a complex iterator, z, is initialized to its screen coordinate: c = x + iy where z(0) = c. The system is then cycled repeatedly so that z(n+1) = z^2(n) + c. At each iteration the complex magnitude of z is computed. If this value remains stable and does not diverge, its starting point at c is a member of the set (see Fig 2 below). For the remaining points – those that fly off into infinity – we can visualise how long each one takes to ‘escape’ by using a colour/intensity encoding. Since points further from the boundary of the set tend to escape faster than those close to its perimeter, the set proper appears to radiate an arua when rendered using a continuous escape time algorithm (see Fig 1 above). This encoding also gives rise to the characteristic forks and spirals so often seen in images of fractals.
Fig 2: A binary map of points that are elements (black) or non-elements (white) of the Mandelbrot set
A close cousin of the Mandelbrot set, the Julia set, is based on the same mechanics. In its case, however, z(n+1) = z^2(n) + q, where q is a complex parameter and z(0) = c. This reliance on both q and c as variables means the Julia set is parametrically 4-dimensional. Thus, displaying it on a screen requires taking a 2-D slice for some fixed value of p.
All of this raises an interesting question: as a 4-dimensional object, it is not possible for us to “see” the compete set on a 2-D plane except as slices in c. However, is there some way we can sample intervals in all dimensions simultaneously, thereby communicating more information about the nature of the fractal in a single image?
We start by considering each q as a plane in some pixel (x, y). A pixel, as a scalar tuple, could therefore be used to encode the integral over some subset of points in q. Choosing a good subset is critical since we’re looking to extrapolate an image which considers both intervals in both domains c and q, and yet also yields an image that is visually pleasing. We can experiment by sampling randomly over q for each pixel but quickly find that the result resembles an “out-of-focus” version of the original fractal. This analogy to a camera lens is a good one because it describes a similar phenomenon; we are essentially defocusing the fractal in the q domain. Better, then, might be integrating along a locus of points that satisfies some given criteria. We experiment by making our interval in p conform to |p| = 1. The results are below:
Fig 3: a) Focussed and b) Swept Mandelbrot sets.
On the left is the ‘focussed’ fractal, its interval in q restricted to a single point on the origin. On the right is the integrated version where samples in q are a distance of 1 from the origin. Although the ghost of the original Mandelbrot set is visible, other details have appeared due to the sweep formed through the domain of q. In particular, asymmetric contours that do not follow the shape of the set are clearly visible. So it seems we can produce a more interesting image by sweeping and integrating. Furthermore, the choice of locus shape and position strongly affects the pattern and formation of the swept image. Unfortunately, the example above has a distinctly muddy feel to it with “interesting” details appearing clouded and indistinct. Can we do better?
Instead of taking the mean value of the colour encoding over the sweep locus, we can instead calculate the resultant intensity based upon the second central moment (the variance) of the integral function. This means that if a pixel has a non-zero mean but a zero variance, the output will be black. This serves to attenuate the regions of the fractal that do not change and also to enhance regions where the locus passes close to the set boundary. This is particularly beneficial since the Julia set is locally connected (hypothetically, at least) and allows for impressive plasma-like arcs of light. We can improve our integrator still further by choosing the sample colour based upon the its position on the locus rather than based on its escape time value.
Fig 4: More swept Mandelbrot sets, rendered using a second moment sample scheme.
The image above was rendered using a spiral locus (inset) and a spectral gradient map to determine the colour. By temporally varying the phase of the spiral, we can transform the still image above into an animation:
Although similar in form to the popular class of fractals based on iterated function systems (flames), swept fractals do not offer the same versatility. This is due to the fairly limited choice of underlying recursive formulae which defines the extent of the set. However, it is still possible to get different images by using variations on the Mandelbrot and Julia sets. Amongst these is the Manowar set (below) which is simpler and results in the shape of the locus itself becoming clearly visible in the rendered image:
Fig 5: A swept fractal sampled from the Manowar set.
Messing around with fractals can become an enormous time sink, not least because you never really get the same image twice. The interested reader is directed to articles on the Buddhabrot fractal, the 3D Mandelbub and Quaternion fractals, and the multitude of fractal zoomers available to download online. Other interesting resources include fractional brownian motion for texture generation and the use of fractals in image compression (PDF link).
Enjoy!


















