Skip to main content

A program for generating Mandelbrot fractal images

Project description

This is a program which generates the Mandelbrot fractal set of a given width and height for a given number of iterations.

It uses Pillow, the Python Imaging Library fork to render the image and save it to a file.

Sample Usage.

To see all command line arguments, pass -h to the program.

$ mandelbrot -h usage: mandelbrot [-h] [-W WIDTH] [-H HEIGHT] [-n NITER] [-o OUTPUT]

Mandelbrot fractal generator

optional arguments:
-h, --help show this help message and exit
-W WIDTH, --width WIDTH
 Width of the image
-H HEIGHT, --height HEIGHT
 Height of the image
-n NITER, --niter NITER
 Number of iterations
-o OUTPUT, --output OUTPUT
 Name of output image file

By default, the program generates a mandelbrot fractal image of size 640x480 pixels to a file named mandelbrot.png for 1000 iterations to a file named mandelbrot.png .

$ mandelbrot Creating mandelbrot set with size 640x480, #iterations=1000

Here is an example of creating an image of size 1280x720 pixels with 5000 iterations and saving it to mandelbrot_big.png

$ mandelbrot -W 1280 -H 720 -n 5000 -o mandelbrot_big.png

The package also includes the ‘mandelbrot_mp’ program which uses PyMP to improve performance by parallel execution on multiple cores in the machine if available. The command line arguments remain the same.

Project details


Release history Release notifications

This version
History Node

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
mandelbrot-0.1.tar.gz (3.0 kB) Copy SHA256 hash SHA256 Source None Feb 6, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page