For each pixel, map its screen coordinates to a complex number c and iterate z = z*z + c starting from z = 0. If the magnitude of z exceeds 2, the point has escaped and lies outside the Mandelbrot set. Points that never escape are inside the set and render black. The set's boundary has infinite perimeter but encloses finite area, a fractal with Hausdorff dimension 2.
The escape iteration count determines the color. Naive integer banding produces harsh contour lines, so this implementation uses smooth coloring: n - log2(log2(|z|)) at the escape point, which interpolates continuously between iteration bands. The result is a gradient that flows smoothly across the exterior, revealing the underlying potential function of the iteration.
Rendered in a single fragment shader on the GPU. Every pixel evaluates the iteration loop independently, making the Mandelbrot set embarrassingly parallel and ideal for GPU computation. Zooming multiplies the maximum iteration count because finer structure near the boundary needs more iterations to resolve. Deep zooms eventually hit the precision limit of 32-bit floats, around 10^7x magnification, where the image pixelates.
Click to zoom into any region. Drag to pan. Look for miniature copies of the full set embedded along filaments. Every bulb and antenna contains self-similar structure at arbitrary depth. The largest cardioid corresponds to period-1 orbits, the main bulb to period-2, and each smaller satellite to higher periods.
Wikipedia