Aptus is a Mandelbrot set viewer and renderer. It is written in Python 9 | with a computation engine in C for speed. 10 |
11 | 12 |
14 | Aptus requires Python 3.9 or greater.
22 | 23 |Use pip to install Aptus. The web interface requires the "web" extra:
24 | 25 |python3.9 -m pip install "aptus[web]"
26 |
27 | The source is available on 30 | GitHub if you prefer direct access to the code, including recent 31 | changes.
32 | 33 | 34 |There are two ways to use Aptus: a browser-based explorer, and a command line 37 | renderer. There is also an older GUI which doesn't work as well as it used to, 38 | but has more features than the browser interface. The browser and GUI let you 39 | zoom in and out, and change the color palette to find an image you like. The 40 | command line renderer produces higher-quality images.
41 | 42 |To launch the web interface, use the "aptusweb" command. It starts a local 45 | web server on http://127.0.0.1:8042. Open 46 | that URL in your browser, and you should see a Mandelbrot set.
47 | 48 |Hitting the "?" key will bring up a help panel, but briefly, click to zoom 49 | in, shift-click to zoom out. Dragging will move the image around, and 50 | shift-dragging will select a new rectangle to view.
51 | 52 |The "s" key will render a downloadable image with super-sampling for higher 53 | quality.
54 | 55 |When saving an image as a .PNG file, Aptus also stores all its parameter 58 | information in a text block hidden in the image, so that the .PNG can be used 59 | directly as a parameter file for the command line renderer.
60 | 61 |The GUI interface runs with the "aptusgui" command. Details of how to use it 64 | are on the older Aptus page.
65 | 66 | 67 |The command line renderer is called "aptuscmd". It will accept a number of 70 | switches or parameter files: 71 |
72 | 73 |
74 | Usage: aptuscmd [options] [parameterfile]
75 |
76 | Aptus renders Mandelbrot set images. Three flavors are available: aptusweb and
77 | aptusgui for interactive exploration, and aptuscmd for high-quality rendering.
78 |
79 | Options:
80 | -h, --help show this help message and exit
81 | -a ANGLE, --angle=ANGLE
82 | set the angle of rotation
83 | --center=RE,IM set the center of the view
84 | -c, --continuous use continuous coloring
85 | --diam=DIAM set the diameter of the view
86 | -i ITER_LIMIT, --iterlimit=ITER_LIMIT
87 | set the limit on the iteration count
88 | -o OUTFILE, --output=OUTFILE
89 | set the output filename (aptuscmd only)
90 | --phase=PHASE set the palette phase
91 | --pscale=SCALE set the palette scale
92 | -s WIDxHGT, --size=WIDxHGT
93 | set the pixel size of the image
94 | --super=S set the supersample rate (aptuscmd only)
95 |
96 |
97 |
98 | Aptus Mandelbrot explorer.
35 |Type ? for help.
36 |Aptus {{version}}, Mandelbrot set explorer.
41 | 42 |Copyright 2007-2024, Ned Batchelder.
43 |
http://nedbatchelder.com/code/aptus/v3.html
44 |
47 | a set the angle
48 | c toggle continuous coloring
49 | F toggle full-screen
50 | i set the iteration limit
51 | I toggle the computation parameters panel
52 | L display a permalink
53 |
54 | r redraw
55 | R reset everything
56 | s render and save a super-sampled image
57 | U upload a file
58 | w set the canvas size
59 | ( ) rotate the angle {{altnote}}
60 | < > cycle through palettes
61 | , . cycle the palette one color
62 | ; ' stretch the colors, if continuous {{altnote}}
63 | [ ] adjust the hue {{altnote}}
64 | { } adjust the saturation {{altnote}}
65 | - = adjust the lightness {{altnote}}
66 | 0 (zero) reset all color adjustments
67 | ? toggle help panel
68 |
70 | click: zoom in {{altnote}}
71 | shift-click: zoom out {{altnote}}
72 | drag: pan the view
73 | shift-drag: select new view area
74 |
75 | {{altnote}} +{{alt}}: just a little
76 |
92 |
93 |
94 | 95 | 96 |
UPLOAD
113 ||
94 | Aptus %(version)s, Mandelbrot set explorer. 95 | Copyright 2007-2020, Ned Batchelder. 96 | http://nedbatchelder.com/code/aptus 97 | |
98 |
102 | Interactive | 103 | Command line | 104 | About
105 |Interactive controls:
110 | 111 |112 | a: set the angle of rotation.136 | 137 |
113 | c: toggle continuous coloring.
114 | f: toggle full-screen display.
115 | h or ?: show this help.
116 | i: set the limit on iterations.
117 | j: jump among a few pre-determined locations.
118 | n: create a new window.
119 | o: open a saved settings or image file.
120 | r: redraw the current image.
121 | s: save the current image or settings.
122 | w: set the window size.
123 | < or >: switch to the next palette.
124 | , or .: cycle the current palette one color.
125 | ; or ': stretch the palette colors (+%(ctrl)s: just a little), if continuous.
126 | [ or ]: adjust the hue of the palette (+%(ctrl)s: just a little).
127 | { or }: adjust the saturation of the palette (+%(ctrl)s: just a little).
128 | 0 (zero): reset all palette adjustments.
129 | space: drag mode: click to drag the image to a new position.
130 | shift: indicate a point of interest for Julia set and point info.
131 | left-click: zoom in (+%(ctrl)s: just a little).
132 | right-click: zoom out (+%(ctrl)s: just a little).
133 | left-drag: select a new rectangle to display.
134 | middle-drag: drag the image to a new position.
135 |
Tool windows: press a key to toggle on and off:
138 | 139 |140 | J (shift-j): Show a Julia set for the current (shift-hovered) point.146 | """, 147 | 148 | 'command': """ 149 |
141 | l (ell): Show zoom snapshots indicating the current position.
142 | p: Show a list of palettes that can be applied to the current view.
143 | q: Show point info for the current (shift-hovered) point.
144 | v: Show statistics for the latest calculation. 145 |
On the command line, use --help to see options:
150 |""" + AptusOptions(None).options_help() + "", 151 | 152 | 'about': """ 153 |
Built with 154 | Python, wxPython, 155 | numpy, and 156 | PIL.
157 | 158 |Thanks to Rob McMullen and Paul Ollis for help with the drawing code.
159 | 160 |Installed versions:
162 |
163 | Aptus: %(version)s
164 | Python: %(python_version)s
165 | wx: %(wx_version)s
166 | numpy: %(numpy_version)s
167 | PIL: %(pil_version)s
168 |
Aptus is a Mandelbrot set viewer and renderer. It is written in Python 20 | with a computation engine in C for speed. 21 |
22 | 23 |
25 | Aptus installs like any other Python package. 32 | Before installing Aptus, you'll need to install these prerequisite Python packages:
33 | 34 |Download the kit that's right for you. Linux and Mac use the tar.gz, Windows 42 | users will probably be happier with the .exe:
43 | 44 |Install the kit with the usual command:
48 | 49 |python setup.py install
50 |
51 | The source is available on bitbucket if you 54 | prefer direct access to the code, including recent changes.
55 | 56 | 57 |There are two ways to use Aptus: a GUI explorer, and a command line renderer. 60 | The GUI lets you zoom in and out, and change the color palette to find an image 61 | you like. The command line renderer produces higher-quality images. 62 |
63 | 64 |Aptus stores information about the image to display in a few ways. Small 67 | textual .aptus files store all the parameters needed to recreate an image, 68 | and can be saved from the GUI and fed to the command line renderer.
69 | 70 |When saving an image as a .PNG file, Aptus also stores all its parameter 71 | information in a text block hidden in the image, so that the .PNG can be used 72 | directly as a parameter file. 73 |
74 | 75 |Aptus can also read Xaos 76 | .xpf files so that you can use Xaos to explore, and Aptus to render if you like.
77 | 78 |Start Aptus with aptusgui.py, and start poking around. Left click or drag 81 | zooms you in, right click zooms you out. Type 'h' for help on other controls. 82 | Detailed descriptions of GUI behavior are below.
83 | 84 |aptusgui.py also accepts applicable command-line switches so you can start it from a 85 | parameter file, or specify the size of the window, and so on.
86 | 87 | 88 |The command line renderer is called aptuscmd.py. It will accept a number of 91 | switches or parameter files: 92 |
93 | 94 |
95 | Usage: aptuscmd.py [options] [parameterfile]
96 |
97 | Aptus renders Mandelbrot set images. Two flavors are available: aptusgui.py
98 | for interactive exploration, and aptuscmd.py for high-quality rendering.
99 |
100 | Options:
101 | -h, --help show this help message and exit
102 | -a ANGLE, --angle=ANGLE
103 | set the angle of rotation
104 | --center=RE,IM set the center of the view
105 | -c, --continuous use continuous coloring
106 | --diam=DIAM set the diameter of the view
107 | -i ITER_LIMIT, --iterlimit=ITER_LIMIT
108 | set the limit on the iteration count
109 | -o OUTFILE, --output=OUTFILE
110 | set the output filename (aptuscmd.py only)
111 | --phase=PHASE set the palette phase
112 | --pscale=SCALE set the palette scale
113 | -s WIDxHGT, --size=WIDxHGT
114 | set the pixel size of the image
115 | --super=S set the supersample rate (aptuscmd.py only)
116 |
117 |
118 |
119 | The Aptus GUI is very bare: there's just an image of the Mandelbrot set, with 122 | no visible controls. You use the mouse and keyboard to control Aptus.
123 | 124 |Left-clicking zooms into the set, right-clicking zooms out; clicking while 127 | holding the Ctrl (or Cmd) key zooms just a little bit. If you drag out a 128 | rectangle with the left mouse button, you will zoom into that rectangle, so you 129 | have more control over exactly where you end up.
130 | 131 |If you drag with the middle mouse button, you will drag the image, re-centering 132 | it on a new point of interest.
133 | 134 |The 'a' key will prompt you for a new angle of rotation for the image.
135 | 136 |The 'n' key will open a new top-level window to explore elsewhere in the set.
137 | 138 |The image of the Mandelbrot set is drawn by calculating a value at each pixel,
141 | then mapping that value to a color through a palette. The values can be discrete
142 | or continuous
The accuracy of the black boundary of the set depends on the number of iterations 145 | Aptus is permitted to calculate at each point. The value can be adjusted with 146 | the 'i' key.
147 | 148 |Aptus has handful of different palettes. Cycle through them with the '<'
149 | (less-than) and '>' (greater-than) keys. A list of all the palettes can be
150 | displayed with 'p'. The color mapped to each value can be shifted one color with
151 | the ',' (comma) and '.' (period) keys. If the pixel values are continuous, then
152 | the palette can also be scaled to change the distance between color bands
153 |
The hue and saturation of the palette can also be shifted. The '[' and ']' 157 | (square bracket) keys change the hue, and '{' and '}' (curly braces) change the 158 | saturation. Both also use the Ctrl key to change just a little.
159 | 160 |The '0' (zero) key will reset all palette adjustments.
161 | 162 |Aptus has a few tool windows. Each is toggled with a particular key.
165 | 166 |'p' displays a list of all Aptus' palettes. Clicking one will change 167 | the display to use it.
168 | 169 |'v' displays a list of statistics about the last fractal calculation.
170 | 171 |'q' displays information about a point in the display. Hold the shift key 172 | and hover over a point in the image to see iteration counts, coordinates, and so on.
173 | 174 |'l' (lowercase L) displays the You Are Here panel. It shows a series of images, 175 | zooming in to the currently displayed view of the set. Each image has a rectangle 176 | drawn on it corresponding to the next image in the list, so that you can see 177 | how your close-up view in the main window relates to the larger set. Any rectangle 178 | can be dragged to change the main window's view of the set.
179 | 180 | 181 |The Julia set is closely related to the Mandelbrot set. Each point in the 184 | Mandelbrot set corresponds to a Julia set. To display the Julia set, use the 'J' 185 | key (with the shift key). A small tool window appears. It shows the Julia set 186 | for the current shift-hovered point in the main window. Hold the shift key and 187 | move the mouse over the Mandelbrot set. The Julia set will change as the mouse 188 | moves.
189 | 190 |To further explore a particular Julia set, double-click in the Julia set window. 191 | You'll get a new top-level window displaying the Julia set, and you can use all 192 | the usual Aptus controls to navigate and manipulate the image.
193 | 194 | 195 |More display improvements and simplifications. Thanks, Paul Ollis.
226 | 227 | 228 |The display is now flicker-free. Thanks, Rob McMullen.
231 | 232 | 233 |Fixed a few bugs, including not drawing at all on Mac or Linux!
236 | 237 | 238 |A number of improvements:
241 | 242 |First version.
271 | 272 | 273 |