An endless dive into the Mandelbrot set, 10^31 times deep.
The camera dives into Seahorse Valley toward a tiny copy of the whole set, more than 10^31 times deeper than the first view. Plain floating point runs out of precision around a zoom of 10^14, so the program computes one reference orbit with BigInt arithmetic and tracks every other pixel as a small difference from it, a technique called perturbation, rebasing pixels onto the reference whenever they drift so the image never glitches. Bilinear approximation lets pixels skip thousands of iterations at once. Keyframes render at each doubling of the zoom and blend into one another, while smooth coloring and a soft relief keep the bands silky.
Try it. Click anywhere to dive toward that point (clicks snap to the nearest detail). Scroll to zoom in or out.
Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.
Build an endless Mandelbrot zoom with JavaScript and the HTML canvas element. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.
Start simple:
- Render into an offscreen canvas at half the window size with ImageData and draw it scaled up.
- For each pixel, iterate z = z^2 + c up to an iteration limit and record when |z| passes a large bailout radius. Use the smooth count n + 1 - log2(log|z|) and map it through a palette of four or five colors you blend between, with points that never escape in near-black.
- Zoom continuously toward a point on the boundary, such as -0.7436438870371587 + 0.1318259042053120i in Seahorse Valley, shrinking the view by a few percent per frame and raising the iteration limit as you go deeper.
- To keep it smooth, render each new image a band of rows per frame, and while it renders, keep drawing the last finished image scaled up to match the current zoom.
Once that works, make it beautiful:
- Plain doubles run out of precision around a zoom of 10^13. Push past it with perturbation: compute one reference orbit at the zoom center with BigInt fixed-point arithmetic, store it as doubles, and iterate every pixel as a small difference from it: delta = 2 * Z * delta + delta^2 + dc.
- When a pixel's |z| becomes smaller than its delta, restart it from the beginning of the reference orbit with delta = z. This rebasing trick avoids the glitches perturbation is known for.
- Cycle the palette slowly with depth, light the escape count like a height map for a soft relief, and show the magnification in a corner.
Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as clicking to choose where to dive, bilinear approximation to skip iterations, or finding a deep minibrot with Newton's method to end the zoom on.