Fractals#

I’ve always found fractals mesmerizing. Infinite complexity from simple rules. Self-similarity at every scale. The boundary between order and chaos rendered as color.

This piece is an interactive explorer — five fractal types, six color palettes, zoom, pan, and parameter knobs.

View fullscreen — scroll to zoom, drag to pan

The Fractals#

Mandelbrot — The classic. Iterate z = z² + c where c is the pixel position. Points that never escape are black (the set). Points that escape are colored by how quickly they leave. Zoom into the boundary and you find spirals, dendrites, miniature copies of the whole set, and structures that seem to go on forever.

Julia — The Mandelbrot’s twin. Same formula, but c is fixed and z starts at the pixel position. Each value of c produces a completely different Julia set. The c-real and c-imag sliders let you sweep through this space in real time. Try c = -0.12 + 0.75i for Douady’s rabbit, or c = 0.28 + 0.01i for a dendrite.

Burning Ship — Uses absolute values in the iteration: z = (|Re(z)| + i|Im(z)|)² + c. The result is jaotic and asymmetric — it looks like a burning ship reflected in water, if you tilt your head. Zoom into the mast for some of the most intricate structures in any fractal.

Tricorn (Mandelbar) — Uses the complex conjugate: z = conj(z)² + c. This produces three-fold symmetry instead of the Mandelbrot’s two-fold, with elaborate tricorn shapes at every level.

Newton — A completely different kind of fractal. It applies Newton’s method to find roots of z³ - 1. Each pixel is colored by which of the three roots it converges to, creating three interlocking basins with a fractal boundary. The color palette maps each basin to a different hue.

The Controls#

Detail (20–500) — How many iterations to compute per pixel. Higher values reveal finer filaments at the set boundary but take longer to render. Start at 120, push to 300+ when zoomed deep.

Shift — Cycles the color palette. Since the palette maps iteration count to color, shifting it changes which colors appear where without changing the underlying math. Small adjustments can dramatically change the mood.

c real / c imag (Julia only) — These two sliders control the complex constant c. Small changes produce wildly different Julia sets. Drag slowly and watch the fractal morph in real time.

Building It#

The renderer uses a two-pass pipeline: an immediate preview at 400×233 pixels for responsive interaction, then a full 1200×700 render after 300ms of inactivity. Both passes compute per-pixel escape times and map them to colors through interpolated palette stops.

Smooth coloring uses the formula n + 1 - log₂(log₂(|z|)) to eliminate the banding that integer iteration counts produce. This gives continuous color gradients even at low iteration counts.

Zoom is centered on the cursor position — the view transforms so the point under your mouse stays fixed while the scale changes. Each scroll step zooms 15%, which gives fine control at deep zoom levels. Coordinates and zoom level are shown in the bottom-left corner.

In the Series#

This is the second interactive piece after Comparison, and the first purely exploratory one. The earlier pieces in the series are about emotions and self-perception. This one is about beauty and mathematics — the pleasure of zooming into something and finding more complexity than you expected, forever.

View the full piece here.