(mandelbrot xmin xmax ymin ymax maxiter width)


  • xmin: The left coordinate on the real axis (inexact)
  • xmax: The right coordinate on the real axis (inexact)
  • ymin: The upper coordinate on the imaginary axis (inexact)
  • ymax: The lower coordinate on the imaginary axis (inexact)
  • maxiter: Maximum number of iterations
  • width: Width of the resulting graymap (height is computed)


This procedure executes the classic mandelbrot escape algorithm and returns a view of the mandelbrot set as a 16 bit graymap at the specified location and with the specified parameters. The way how a pixel belonging to the interior is colored can be specified using the set-mandelbrot-interior-mode! procedure.

Since the graylevels are represented in 16 bits one can hardly see anything directly in many cases, so either graymap-normalize! or graymap-equalize! may be applied afterwards in order to achieve a visually pleasing result.

Return Value

The resulting 16 bit graymap is returned.

See Also


> (define x (mandelbrot -2.0 2.0 -2.0 2.0 200 640))
> (graymap-equalize! x)
> (graymap-writepng x "mandelbrot-test.png")
> (define y (graymap-readpng "mandelbrot-test.png"))
> y
#<graymap(16) orow:-1 ocol:-1 xres:-1 yres:-1 w:640 h:640>
> (graymap-equal? x y)

The 16 bit grayscale PNG image file mandelbrot-test.png displays as follows:


Artwork Examples

The following digital artwork has been generated with the mandelbrot procedure with some postprocessing using Affinity Photo afterwards.

The resulting picture has the dimensions 27976x20982px with 586.99MP in TIFF RGB with 16 bits per channel.

The location coordinates are: xmin 0.270922313433143324272, xmax 0.270922360217271027727, ymin 0.004722307821717227065, ymax 0.004722342880202797249.


The area of this view in the complex plane is -2.0 to 1.0 on the real axis and -1.5 and 1.5 on the imaginary axis: