Mandelbrot image

Interactive Mandelbrot Images

The defined assignment was to create a Mandelbrot image from a user-specified initial X and Y, delta X and delta Y, and desired image resolution. Although the actual routines are written in C, a web front-end was created (this page) to allow world-wide usage of this exploratory program.

The pseudo-code was quickly incorporated as comments into the actual C code, as shown in the Code Archive. The code archive includes:

The Mandelbrot equation is defined as z = z^2 + C where "C" is initially the coordinate in the complex plane and z(0) is C. A Julia set is defined using the same equation, but in this case C is the coordinate in the complex plane. Thus the Mandelbrot set is a set of Julia point solutions. Julia sets outside of the Mandelbrot are dark, and the most interesting behavior occurs near the borders of the Mandelbrot figure.

The following sets were created:

Mandelbrot set (color and pseudo-color) at several zoom levels:

Julia sets for several locations were also made. Alternative pseudo-Mandelbrot sets for different equation forms were made. Several variant equations were attempted. Forms of "z = exp(z) + C" and "z = z*exp(z)" simply produced circles and showed no iterative behavior. Two interesting variants are shown: "z = z(z+C)" and "z = z(1-z)".

You can Generate your Own using a cgibin/Perl interface to this mandelbrot routine. This uses the CSI 761 code to generate Mandelbrot sets for user- provided parameters. The coloring routine is a simple quantizing of the final image to 256 colors. The current parameter limits are: x and y must be in the range of [-2,2] and the image must be 2048x2048 pixels or smaller. Note that higher definitions (number of pixels) increase the calculation time significantly, while changing the region limits doesn't affect calculation time.

The plotting was done in two fashions. The interactive program uses the pbmplus suite (specifically, pgmtoppm, ppmquant (to quantize colors), ad ppmtogif (to make GIFs). This allows quick interactive generation of GIFs. The grayscale images are converted to a pseudo-color image by mapping high iterations to black and low iterations to red. The full color plots were done using Matlab with the 'jet' colormap. Matlab uses an odd scaling flip when plotting, such that the axis often become swapped. This leads to odd alignment problems when matching a zoomed section against the entire figure (since the orientation may have shifted). However, it is more colorful and has more axis and title options. Therefore, we use the pbmplus images for interactive plotting, and the Matlab ones for final "proofs". One could play with colormaps and scaling for days.

As the archive pictures show, the different scalings of the colormaps cause different features to be highlighted. This is most noticeable in the zoomed Mandelbrot images, where a low end compression highlights the differences between the points outside the set (few iterations before solved before the exit condition is met) while compressing the high end (near out maximum number of iterations, in these cases 1000) causes other features to be shown. The visualization is therefore crucial.

Additional Resources

Bad programmers can learn all they need from the following Obfuscated C entry, "A mandelbrot plotter".

A more useful resource (and better online plotters than mine!) are available at a number of sites, of which Zsolt's page (http://chem.leeds.ac.uk/ICAMS/people/zsolt/mandel.html) is one of the more complete.

Finally, an archive of this code, postscript plots, and this document (in postscript) are available off this page, for people that prefer hardcopy.

back to Sandy's page