Frex - in the browser

Over a decade ago, I was playing around with a fractal generator on Android, experimenting with the idea of using tiles and texturing them with the fractal image. Nearly two decades before that, I was staying up late exploring fractals with a monochrome monitor, a hand-me-down PC XT, and a 40 MB large hard disk drive that held the wonderful Fractint program.

I always wanted to have my own version of this, and I wanted it accessible anywhere. I wanted to keep the tile approach, like a “Google Maps for fractals”, so I turned to Claude to help me code this up. Initially this felt like cheating, and the UI looked like so many other projects created by AI (there seems to be a distinctive “look” about the UI they create). But I adjusted to taking on the role of a designer instead of a coder, and stripped it down to a simpler UI, and something that could adapt to the hardware that was running it.

The project uses Rust to calculate the iterations within each tile, dispatched across a pool of workers to enable parallel generation. The main app is a Javascript frontend that handles the navigation and culls off-screen tiles and renders through WebGL2 (if supported, else it falls back to Canvas2D). One of the coolest features I think is that the URL updates to what is currently displayed - so if you want to share or bookmark a location, that’s all encoded in the URL.

Limitations right now are that it’s just the Mandelbrot fractal, and you’ll eventually hit a zoom limit where the pixels are very… pixel-y. Also there are some fun things where zooming in and out quickly will cause glitches.

But what does work is I think… pretty nice. There is a home icon to go back to the standard zoom after exploring. You can change the color palette. You can cycle the colors (the current color you’re at isn’t stored in the URL), and of course, you can very quickly zoom and pan around a fractal.

Here is a URL https://frex.kristiangolding.com/#f=mandelbrot&c=psychedelic&x=-1.3646818153371199&y=0.03759393787575152&z=318.8486772

and the associated image

Frex is available at frex.kristiangolding.com.