/fractal

💥A fractal generator

Primary LanguagePython

fractal

An interactive Mandelbrot generator with a Numpy and Numba JIT backend. The fractal is generated using either the Numpy based or the Numba based backend and rendered with Matplotlib and TKinter. The backend can be toggled during execution. The Numba JIT backend offers significant framerate gain over simply computing the image in Numpy, but both are available as this was mostly an excercize in testing the relative performance of these two methods. Numba is the default backend. As the zoom level is increased the iteration depth is dynamically adjusted.

"mandelbrot" "zoomed mandelbrot"

Requirements

  • Python3
  • Numba
  • Numpy
  • Matplotlib
  • tkinter

Setup

pip install -r requirements.txt apt-get install python3-tk - Depends on platform

Usage

usage: fractal.py [-h] [-k {np,nb}] w h

Fractal Renderer

positional arguments:
  w
  h

optional arguments:
  -h, --help            show this help message and exit
  --kernel {np,nb}
  • Left Mouse - Translate
  • Right Mouse - Zoom
  • 1234 - Change colors
  • R - Reset view
  • -+ - Adjust iteration depth
  • T - Toggle renderer backend
  • ESC - Quit