Aptus is a Mandelbrot set viewer and renderer. It is written in Python with a computation engine in C for speed.

A portion of the Mandelbrot set

Getting Aptus

Pre-requisites

Aptus installs like any other Python package. Before installing Aptus, you'll need to install these prerequisite Python packages:

Installation

Download the kit that's right for you. Linux and Mac use the tar.gz, Windows users will probably be happier with the .exe:

Download: Aptus-1.56.tar.gz
Download: Aptus-1.56.win32-py2.5.exe

Install the kit with the usual command:

python setup.py install

Using Aptus

There are two ways to use Aptus: a GUI explorer, and a command line renderer. The GUI lets you zoom in and out, and change the color palette to find an image you like. The command line renderer produces higher-quality images.

Parameter files

Aptus stores information about the image to display in a few ways. Small textual .aptus files store all the parameters needed to recreate an image, and can be saved from the GUI and fed to the command line renderer.

When saving an image as a .PNG file, Aptus also stores all its parameter information in a text block hidden in the image, so that the .PNG can be used directly as a parameter file.

Aptus can also read Xaos .xpf files so that you can use Xaos to explore, and Aptus to render if you like.

GUI usage

Start Aptus with aptusgui.py, and start poking around. Left click or drag zooms you in, right click zooms you out. Type 'h' for help on other controls.

aptusgui.py also accepts applicable command-line switches so you can start it from a parameter file, or specify the size of the window, and so on.

Command line usage

The command line renderer is called aptuscmd.py. It will accept a number of switches or parameter files:

Usage: aptuscmd.py [options] [parameterfile]

Aptus renders Mandelbrot set images. Two flavors are available: aptusgui.py
for interactive exploration, and aptuscmd.py for high-quality rendering.

Options:
  -h, --help            show this help message and exit
  -a ANGLE, --angle=ANGLE
                        set the angle of rotation
  -b BAILOUT, --bailout=BAILOUT
                        set the radius of the escape circle
  -c, --continuous      use continuous coloring
  -i ITER_LIMIT, --iterlimit=ITER_LIMIT
                        set the limit on the iteration count
  -o OUTFILE, --output=OUTFILE
                        set the output filename (aptuscmd.py only)
  --phase=PHASE         set the palette phase
  --pscale=SCALE        set the palette scale
  -s WIDxHGT, --size=WIDxHGT
                        set the pixel size of the image
  --super=S             set the supersample rate (aptuscmd.py only)

History

Version 1.56, April 2008

More display improvements and simplifications. Thanks, Paul Ollis.

Version 1.55, April 2008

The display is now flicker-free. Thanks, Rob McMullen.

Version 1.51, March 2008

Fixed a few bugs, including not drawing at all on Mac or Linux!

Version 1.5, March 2008

A number of improvements:

  • Continuous coloring.
  • Arbitrary rotation support.
  • Middle mouse button drags the image.
  • Palette tweaking:
    • Hue and saturation adjustments.
    • Scaling the palette to adjust distance between colors.
  • Statistics:
    • More statistics: boundaries traced, boundaries filled, and points computed.
    • Statistics are written into the final .PNG files.
  • Reads .xet files from servebeer.com.
  • Some old .aptus files recorded the y coordinate incorrectly, and will now render upside-down: negate the y component of the center to fix this.

Version 1.0, October 2007

First version.

More samples

A portion of the Mandelbrot setA portion of the Mandelbrot set
A portion of the Mandelbrot setA portion of the Mandelbrot set

See also

  • Xaos, a full-featured fractal explorer which has many more rendering and fractal options than Aptus.
  • Gnofract 4D, a Linux-based fractal exploration program.
  • My blog, where recreational math and Python topics intersect from time to time.

Comments

[gravatar]
Gustaf Erikson 10:11 AM on 13 Oct 2007

Hi! Sounds like an interesting app. I've been fascinated by fractals since learning about them in high school, lo these many years ago.

I've tried installing the app in Ubuntu Linux. It's compiled and installed. However, when I run

$ python /usr/bin/aptusgui.py

I get a gray window and a bunch of error messages to the console. The central error is

RuntimeError: Failed to gain raw access to bitmap data.

I think I've got all the prerequisites installed, otherwise I shouldn't have been able to install it, right?

Thanks,

/g.

[gravatar]
Rob McMullen 12:02 PM on 18 Mar 2008

I was experimenting with a numpy version, and wanted to see if I could code up a faster version in C. The obligatory google search turned up your version; well done!

A segfault turned up on my amd64 machine with python 2.5: I had to change "int ncolbytes" to "Py_ssize_t ncolbytes" (line 504 in engine.c). It looks like the API for PyString_AsStringAndSize changed between python 2.4 and 2.5...

[gravatar]
Ned Batchelder 9:32 PM on 18 Mar 2008

Rob, thanks for the micro-patch. The problem wasn't the change from 2.4 to 2.5 (I build Aptus under 2.5), but that I am using a 32-bit platform where there is no difference between Py_ssize_t and int.

[gravatar]
Chetan Nichkawde 1:52 AM on 2 Apr 2008

Hi,
I installed the thing. However, whenever I start I get following :

manager@mac03:/srv/home$ aptusgui.py
: No such file or directory

I do not what command line arguments to pass (if any). I just want to get started.

Chetan

[gravatar]
Ned Batchelder 5:54 AM on 3 Apr 2008

@Chetan: the problem is a DOS line-ending in the aptusgui.py file (and aptuscmd.py). I'll post a new kit shortly with the problem fixed. In the meantime, you can either edit the file yourself, or run the commands as "python /path/to/your/aptusgui.py"

[gravatar]
Chetan Nichkawde 6:15 AM on 3 Apr 2008

Thanks! Its works. Great piece of art.

Add a comment:

name
email
Ignore this:
not displayed and no spam.
Leave this empty:
www
not searched.
 
Name and either email or www are required.
Don't put anything here:
Leave this empty:
URLs auto-link and some tags are allowed: <a><b><i><p><br><pre>.