Barnsley Fern Generator

Plot the famous IFS attractor point by point. Adjust how many samples you draw, how fast the loop runs, and how color maps across the visit order. The canvas scales with your screen so phones still get a tall frond.

Local canvas
Progress
Elapsed
Throughput
Advanced plot controls

Screen resolution is the real enemy

Ultra-high iteration counts still look thin on a dense phone display unless you widen point size or zoom the coordinate map. This demo keeps Michael Barnsley’s standard coefficients; you are trading time, brightness, and aliasing, not mathematical novelty.

We recommend capping runs around one hundred thousand points on older phones. Fans of chaotic sampling pairs should open the Chaos Game Generator next; the logic rhymes even when the picture differs.

What each probability buys you

Each row is one affine map plus its selection probability. The percentages must sum to one hundred; the classic fern uses the split below.

RoleProbabilityEffect
Stem map1%Collapses most mass toward the central stalk.
Main frond85%Contracts and lifts successive points into the large leaf body.
Left leaflet7%Throws visits to the smaller left branch.
Right leaflet7%Mirrors the left branch on the opposite side.

Numbers follow the usual textbook presentation; slight rounding appears in some sources.

Why random picks still draw a fixed shape

You maintain a single point in the plane. Each step chooses one of four linear maps at random, applies coefficients, and plots the new coordinate. Randomness controls the visit order, not the final set. Given enough steps, the pixel cloud converges toward the same attractor because each map is a contraction on the region that matters.

The update rule is the pair of equations x' = a x + b y + e and y' = c x + d y + f with constants taken from the table above. Repeating the pick-and-apply loop is the entire engine.

What your device does between frames

Every time the loop wakes up, the script rolls a uniform random number, walks the cumulative probability ladder, applies one affine map, converts world coordinates to pixel space, and writes a tiny rectangle. None of that requires a server. The heavy cost is paint work on the canvas, which grows when you raise points-per-frame or pick rainbow coloring that forces constant style changes.

High-DPI screens multiply internal bitmap dimensions so lines look crisp. That also means clearing and filling touch more memory. If the tab stutters, treat the symptom by lowering speed before you assume the math is wrong.

Where people actually use this

Lecture demos
Instructors animate the scatter filling in so students see probabilities as geometry instead of abstract percentages.
Procedural art
Color modes here follow iteration index, which highlights visit order. Artists export PNG frames for textures or social posts.
Compression intuition
IFS research connects to encoding natural shapes with compact parameters; the fern is the poster child for “short recipe, long output.”
Pipeline comparisons
Teams compare this attractor against grammar-based plants from the L-System Visualizer when picking a generation strategy.

Questions about the Barnsley fern plotter

Usage, performance, and privacy on one page.

Does changing the random seed alter the final fern?

No. The attractor is the same; only the order of dots and transient speckle differ. If two runs use the same iteration cap, you still see the same overall silhouette once the canvas fills.

Why does the generator slow down on my phone?

Each frame paints up to the “points per frame” value you select. Large counts plus rainbow color shifts force more canvas writes. Drop the speed preset, shrink iterations, or switch to solid green for smoother playback.

Are my images uploaded anywhere?

No. Every sample stays inside the browser tab. Saving PNG uses the canvas data URL locally. Nothing is transmitted to Toolexe servers for plotting.

Can I edit the affine coefficients here?

Not in this interface. The page locks the classical parameters so beginners always see the canonical fern. Breaking symmetry requires a different build or your own script.

How does this relate to other fractal tools on Toolexe?

IFS chaos games differ from escape-time plots such as the Mandelbrot set. If you want complex-plane coloring, open the Mandelbrot Set Generator or the Julia tools in the same math collection. They solve another family of equations entirely.