Realtime Polynomial Fractal Explorer

The Real-Time Polynomial Fractal Explorer is a Python desktop application that turns the complex plane into an interactive laboratory. At its core it applies the escape-time routine:

Zn+1 = P(Zn) +C
P(z) = a0 + a1z + a2z2 ++ adzd

where C is the complex coordinate of each pixel and the coefficients a0 ad come straight from editable entry boxes in the toolbar. A checkbox shifts the engine into “spiral-brot” mode by replacing P(z) with a non-integer power:

Zn+1 = Znp +C
(p is any positive real).

Every keystroke (i/o to zoom, w a s d to pan, mouse-click to recenter) spawns thousands of parallel CuPy threads (or NumPy when no CUDA device is present). They iterate until |Z| breaches an adaptive escape radius, then record the iteration count. To remove discrete colour bands the raw count n is refined with the standard smooth-colour correction:

s=n log2 ( log2 |Zn| ) log2 d

followed by on-the-fly histogram equalisation. A sine-based tone curve and a user-set exponent stretch or compress mid-tones:

c= [ 2 π arcsin(s) ] sine_power × colour_bands

before the values drive one of several 256-entry cyclic palettes drawn from the cmasher and cmocean libraries, ensuring seamless gradients even when colours wrap.

Supersampling up to 4 × and 16-bit OpenCV pipelines keep output pristine. A single click exports high-resolution stills (8 K+ is routine) or assembles smooth zoom-flight videos; the video renderer tiles and re-uses pre-calculated frames so deep dives stay practical. All exports preserve the current centre point, aspect ratio, maximum-iteration limit, and your chosen polynomial or power.

What emerges is a blend of mathematical sandbox and visual-effects tool: you can swap a coefficient to explore high-degree multibrots, slide the sine-power control to reshape the palette in real time, or batch-render a flight through parameter space—always with immediate visual feedback and without leaving Python.