All Projects → jlesuffleur → gpu_mandelbrot

jlesuffleur / gpu_mandelbrot

Licence: MIT license
Interactive Mandelbrot set on GPU with Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to gpu mandelbrot

scipy-crash-course
Material for a 24 hours course on Scientific Python
Stars: ✭ 98 (+196.97%)
Mutual labels:  matplotlib, numba
Pynamical
Pynamical is a Python package for modeling and visualizing discrete nonlinear dynamical systems, chaos, and fractals.
Stars: ✭ 458 (+1287.88%)
Mutual labels:  fractal, matplotlib
fractal-starter-kit
Starter kit for Fractal with SCSS, Webpack, XO, sass-lint and Gulp
Stars: ✭ 22 (-33.33%)
Mutual labels:  fractal
anesthetic
Nested Sampling post-processing and plotting
Stars: ✭ 34 (+3.03%)
Mutual labels:  matplotlib
matplotx
📊 More styles and useful extensions for Matplotlib
Stars: ✭ 507 (+1436.36%)
Mutual labels:  matplotlib
Crawler4Caida
一个致力于用Python提高部门工作自动化水平的程序库!(包括数据采集、办公自动化、辅助研究、图网络、复杂系统、3D可视化等)
Stars: ✭ 82 (+148.48%)
Mutual labels:  matplotlib
Algorithmic-Trading
Algorithmic trading using machine learning.
Stars: ✭ 102 (+209.09%)
Mutual labels:  matplotlib
wasabi
A Buddhabrot explorer based on wabisabi, but with a more affectionate name.
Stars: ✭ 17 (-48.48%)
Mutual labels:  fractal
PyBox
A box-model that automatically creates and solves equations used to describe the evolution in atmospheric composition using Python with Numba and, optionally, Fortran.
Stars: ✭ 30 (-9.09%)
Mutual labels:  numba
The-Supervised-Learning-Workshop
An Interactive Approach to Understanding Supervised Learning Algorithms
Stars: ✭ 24 (-27.27%)
Mutual labels:  matplotlib
heatmaps
Better heatmaps in Python
Stars: ✭ 117 (+254.55%)
Mutual labels:  matplotlib
vector-field-visualizer
A python back-end web app to visualize a two dimensional vector field, and to calculate divergence and curl at any point.
Stars: ✭ 23 (-30.3%)
Mutual labels:  matplotlib
dataiter
Python classes for data manipulation
Stars: ✭ 25 (-24.24%)
Mutual labels:  numba
matplotlib-4-abaqus
allow abaqus(v6.14-1) to use matplotlib in its build-in python scripts environment.
Stars: ✭ 32 (-3.03%)
Mutual labels:  matplotlib
gis-snippets
Some code snippets for GIS tasks
Stars: ✭ 45 (+36.36%)
Mutual labels:  fractal
logplot
Awesome interactive plots from custom logs
Stars: ✭ 25 (-24.24%)
Mutual labels:  matplotlib
qmplot
A Python package for creating high-quality manhattan and Q-Q plots from GWAS results.
Stars: ✭ 25 (-24.24%)
Mutual labels:  matplotlib
Data-Science-Articles
A collection of my blogs on Data Science and Machine learning.
Stars: ✭ 66 (+100%)
Mutual labels:  matplotlib
iterated-function-systems
Iterated Function Systems fractals with OCaml.
Stars: ✭ 33 (+0%)
Mutual labels:  fractal
hh research
Автоматизация поиска и исследования вакансий с сайта hh.ru (Headhunter) с помощью методов Python. Классификация данных, поиск статистических параметров.
Stars: ✭ 36 (+9.09%)
Mutual labels:  matplotlib

Fast Mandelbrot set explorer

Features

  • Accelerated on GPU and CPU using numba CUDA JIT
  • Interactive exploration using Matplotlib
    • Use mousewheel or left/right click to zoom in/out
    • Use sliders to change the rendering parameters
  • Save still and animated images (GIF)
  • Smooth iteration coloring, anti-aliasing by oversampling
  • Shading: Blinn-Phong & Lambert lighting, stripe average coloring, steps shading
  • Customizable color palette
  • Precision: zoom down to float64 precision (approx. 16 significants digits)
  • 100% Python 🐍

Quick start

from mandelbrot import Mandelbrot
mand = Mandelbrot() # set `gpu = False` if no GPU is available

Explore the set

# Explore the set using interactive Matplotlib GUI
mand.explore()

Draw an image

# Draw an image and save it to file
mand.draw('mandelbrot.png')

Make a zoom animation

# We decrease the image size to avoid overloading git and the readme page
# We also increase the number of iterations, and add stripe coloring
mand = Mandelbrot(maxiter = 5000, xpixels = 426, stripe_s = 5)
# Point to zoom at
x_real = -1.749705768080503
x_imag = -6.13369029080495e-05
mand.animate(x_real, x_imag, 'mandelbrot.gif')

Run from command line

Use the following command from terminal to launch a GUI with default parameters:

python ./mandelbrot.py

Gallery

Some examples of HD images, and corresponding code:

mand = Mandelbrot(maxiter = 5000, rgb_thetas = [.11, .02, .92], stripe_s = 2,
                  coord = [-0.5503295086752807,
                           -0.5503293049351449,
                           -0.6259346555912755,
                           -0.625934541001796])
mand.draw('crown.png')

mand = Mandelbrot(maxiter = 5000, rgb_thetas = [.29, .02, 0.9], ncycle = 8,
                  step_s = 10,
                  coord = [-1.9854527029227764,
                           -1.9854527027615938,
                           0.00019009159314173224,
                           0.00019009168379912058])
mand.draw('pow.png')

mand = Mandelbrot(maxiter = 5000, rgb_thetas = [.83, .01, .99], stripe_s = 5,
                  coord = [-1.749289287806423,
                           -1.7492892878054118,
                           -1.8709586016347623e-06,
                           -1.8709580332005737e-06])
mand.draw('octogone.png')

mand = Mandelbrot(maxiter = 5000, rgb_thetas = [.87, .83, .77],
                  coord = [-1.9415524417847085,
                           -1.9415524394561112,
                           0.00013385928801614168,
                           0.00013386059768851223])
mand.draw('julia.png')

mand = Mandelbrot(maxiter = 5000, rgb_thetas = [.54, .38, .35], stripe_s = 8,
                  coord = [-0.19569582393630502,
                           -0.19569331188751315,
                           1.1000276413181806,
                           1.10002905416902])
mand.draw('lightning.png')

mand = Mandelbrot(maxiter = 5000, rgb_thetas = [.47, .51, .63], step_s = 20,
                  coord = [-1.7497082019887222,
                           -1.749708201971718,
                           -1.3693697170765535e-07,
                           -1.369274301311596e-07])
mand.draw('web.png')

mand = Mandelbrot(maxiter = 5000, rgb_thetas = [.6, .57, .45], stripe_s = 12,
                  coord = [-1.8605721473418524,
                           -1.860572147340747,
                           -3.1800170324714687e-06,
                           -3.180016406837821e-06])
mand.draw('wave.png')

mand = Mandelbrot(maxiter = 5000, rgb_thetas = [.63, .83, .98],
                  coord = [-0.7545217835886875,
                           -0.7544770820676441,
                           0.05716740181493137,
                           0.05719254327783547])
mand.draw('tiles.png')

mand = Mandelbrot(maxiter = 5000, rgb_thetas = [.29, .52, .59], stripe_s = 5,
                  coord = [-1.6241199193994318,
                           -1.624119919281773,
                           -0.00013088931048083944,
                           -0.0001308892443058033])
mand.draw('velvet.png')

Runtime 🚀

Computing a sequence of 100 frames of HD pictures (1280*720 pixels), with 2000 iterations takes approximately 1 second on a Tesla K80 GPU.

Requirements

  • NumPy
  • Matplotlib
  • Numba
  • (optional, for much faster rendering) A CUDA compatible GPU & CUDA Toolkit
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].