The Buddhabrot is an interesting variation on the well-known Mandelbrot Set, invented by Melinda Green in 1993. It’s a density plot of the orbits of points outside the Mandelbrot Set. The Mandelbrot Set is defined as the set of points whose orbits stay bounded under the iteration of z2 + c where c is a starting point in the complex plane and z is initialised to complex 0. This variation considers those points that do not stay bounded, and in effect plots their density. In her own words:

Instead of selecting initial points on the real-complex plane one for each pixel, initial  points are selected randomly from the image region. Then, each initial point is iterated using the standard mandelbrot function in order to test whether it escapes or not. Only those that do exit are then re-iterated. (The ones that don’t escape – I.E. which are believed to be within the Mandelbrot Set – are ignored). During re-iteration, I do not color a pixel according to the number of iterations used, but instead, I increase a count field for each pixel that it lands on before exiting. Every so often, the current array of “hit counts” is output as an image. Eventually, successive images barely differ from each other, ultimately converging..

I wondered why the points are selected randomly instead of sequentially from a grid. And this does in fact work, but generates some artefacts which I suspect are the Moire of some quantised property (such as floating point round off) with the grid. Sometimes the patterns were pronounced and interesting, and might be worth following up later! Here’s Melinda’s take on ‘why random’.

Quad treeing the Mandelbrot Set
Quad treeing the Mandelbrot Set

I wrote a Python program to do this, using what I think is a novel technique; I could not find on the web any evidence of it. It’s the same technique I used for Mandrian – divide the plane into squares and check the number of iterations before escape of the Mandelbrot function at the corners (always keeping a record of the position, and number of iterations). If they’re all the same then we assume that little of interest is happening here, let’s move on to the next square. This assumption does have some exceptions but for our purposes they don’t matter. When we find a square with variation then we subdivide it into 4 sub-squares and examine those.

Points chosen for Buddhabrot orbits
Points chosen for Buddhabrot orbits

This technique homes in nicely on the boundary of the MS, where the iteration count gets very high. In the next stage we re-visit all the points we recorded, and follow their orbits. Whenever an orbit crosses a pixel in our region of interest, we add 1 to an array representing our display area. This builds up our density map. One refinement has to be added, to improve the resolution and avoid artefacts: we select random points within each pixel to start each orbit, and re-scan the list of points several times. Also, we ignore those points having less than a certain number of iterations.

You might be wondering why points inside the MS are ignored. If you choose them instead, then you get the anti-Buddhabrot (blue picture in the gallery above). Apart from also following the MS outline, it looks fairly different so I suppose that the result of plotting both BB and anti-BB would be a bit of a mess! The take a long time to generate since the points inside the MS take the maximum iterations before you assume they’re part of the MS. You can never be certain that a point is in the MS since the definition implies that such orbits iterate to infinity…

I’ve also experimented with directly colouring the image, and with 3D using the density as a height. These have met with limited success so far. The usual technique for colouring is borrowed from astronomy – take 3 images at different wavelengths (iteration counts in our case) and treat them as RGB levels. I’ll probably try that next.

My code is available on GitHub.

The Buddhabrot is a fractal rendering technique related to the Mandelbrot set. Its name reflects its pareidolic resemblance to classical depictions of Gautama Buddha, seated in a meditation pose with a forehead mark (tikka) and traditional topknot (ushnisha). The map is created by counting the number of times in the iterative creation algorithm a point is visited. (wikipedia)


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.