80000
1.2
0
100%
1.00

More information about the Barnsley Fern

Barnsley Fern

The Barnsley Fern is a fractal built from four tiny formulas. Start at the origin and, over and over, pick one affine map at random. Tens of thousands of points later, a black spleenwort appears. Every leaflet is a smaller copy of the whole frond, so the picture stays detailed at any zoom. Watch the fern grow, zoom into a leaflet, or nudge the coefficients.

How it works

  1. Open this page and watch the fern fill in from the chaos game.
  2. Drag to move and scroll to zoom. A leaflet is the same fern, drawn smaller.
  3. Switch variety, colour points by which transform drew them, or nudge curl and leaflet size, then save a PNG.

Four maps, one frond

Each step applies f(x, y) = a matrix times (x, y), plus a shift. The black spleenwort uses four of these maps. One draws the stem and is chosen about 1% of the time. One copies the fern into a smaller leaflet higher up the stem and is chosen about 85% of the time. The other two draw the lowest left and right pinnae and are chosen about 7% each. Because those pinnae are themselves copies of the whole fern, the side branches appear on their own.

The chaos game

The first point is the origin. Each new point is the image of the previous one under a map chosen with the probabilities above. Plot enough points and the cloud settles on the fern. The same coefficients always make the same shape. The classic frond sits in about −2.18 < x < 2.66 and 0 ≤ y < 10.

Mutants and self-similarity

Change the coefficients and the plant changes. Thelypteridaceae and Leptosporangiate are published four-map cousins of the black spleenwort. Curl leans the stem. Leaflet size scales the two side maps. Colour by transform paints stem, successive leaflets, left pinna, and right pinna in different colours, so you can see which formula drew each point. Scroll in: the detail does not run out.

Frequently asked questions

What is the Barnsley Fern?

A fractal Michael Barnsley introduced to look like the black spleenwort fern, Asplenium adiantum-nigrum. It is an iterated function system: four affine maps, repeated, draw the whole plant.

What do the four transforms do?

One maps every point onto the stem. One makes the next smaller leaflet up the stem. One draws the large left-hand pinna, and one draws the large right-hand pinna. The side pinnae contain smaller copies of the same fern.

Why can I zoom forever?

The fern is self-similar. Each leaflet is the whole frond after one of the maps, so a closer view is another copy of the same construction, not a blur of a fixed drawing.

What is a mutant variety?

The same four-map recipe with different coefficients. Thelypteridaceae and Leptosporangiate are two published mutants. Curl, leaflet size, and Randomize move the coefficients further, which is the idea behind Barnsley's superfractals.

Does the fern leave my device?

No. The points are computed in your browser. Save a PNG or open the canvas in the PictorX editor.

Ready to try it?

Open PictorX in your browser — no install, no credit card required to start.

Go to Editor