This is a command-line program to draw the Mandelbrot set with various parameter options. The Mandelbrot set consists of points c in the complex plane for which the sequence
This program requires the C11 standard and links with math and posix thread libraries. It is expected to work on most common Linux distros and macOS.
To build the program, run
make
If the build is successful, the mandelbrot
executable will be created in the current directory.
Usage with default parameters is simple from command line
./mandelbrot
and this command produces a bitmap file with content similar to the figure below (default size 800 x 600 pixels)
Several parameter options can be given to override the defaults. For example, there is an option that specifies whether the coloring algorithm is continuous (as in the previous figure), histogram or simple, which uses just two different colors. There is a convenient way to see all the options the program can take.
To see all allowed options and short descriptions of their arguments, run the following command
./mandelbrot -s
There are few restrictions on parameter combinations. The histogram coloring algorithm can only be used with the color options red, green and blue. The simple algorithm (-a simple) does not use the color option (-p) at all.
The next example command illustrates a case where multiple arguments are passed to the executable. It plots the Mandelbrot set on a 1920 x 1080 pixel canvas using the histogram coloring algorithm with a maximum iteration count of 250,000 and a red color palette.
./mandelbrot -a histogram -m 250000 -p red -w 1920 -h 1080
The figure below (not to scale) represents a possible result from the previous command