Skip to main content

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.

Release files for mandelbrot 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mandelbrot 0.1
File Size Uploaded
mandelbrot-0.1.tar.gz 3.0 kB Details

Release files / mandelbrot-0.1.tar.gz

Download URL mandelbrot-0.1.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
82e7c625401aed02b7d073de06da935b81213927807421a2b7b00997655a9e1a
BLAKE2b-256 checksum
How to use checksums
326e240da66b0c99623d7e055a6713962f5912f0c358a5eb8d1e87daaeb213fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page