FCM
Fractal Clip Maker
V.2.12
A little program to produce animated Mandelbrot and Julia sets
Title
Copyright (c) 2006-2010 by Friedemann Seebass, Germany
  27 February 2010



Contents
gehe zu deutscher Version



A. Quick Start Guide

1. What is FCM good for?

FCM is a program to produce fractal images. You can:
Okay, there are other programs doing more (see section D.4.), but FCM is very easy to use, I think, even if you don't know what fractal images are. If you want to learn a bit about it read the short introduction in chapter C.

My motivation to add a further fractal generator to the public has been to learn Java Swing; this theme is ideal to do that because the application contains 10 % algorithm and 90 % user interface.

2. System Requirements

Java: FCM is written in Java. First of all you need the Java Runtime Environment version 1.6.0 or newer. The oldest Java version I could test FCM with successfully is 1.6.0_04-b12. Download the newest version from www.java.com (about 16 MB).

Hardware: The weakest machine I tried out to run FCM has been a Pentium 200 MMX with 64 MB RAM. But don't expect clips to play fluently with such an old computer. My Pentium M 1500 plays clips (400 x 300 pixel) with a rate of about 15 frames per second, an AMD Duron 700 reaches 15 fps only with a size of 200 x 200 pixel.

Operating system: Thanks to Java the operating system is not important. I tested FCM on Windows ME, 2000, XP,  Vista, 7, SuSE Linux 10.3 and Ubuntu 6.1.

3. Installation

The installation will need two steps described in the following sections:
If you want to create videos as AVIs or MPEGs you need an additional software like MEncoder. See section B.11 for details.

a) Installing the Java Runtime Environment

First of all check whether the JRE is installed already: Open a console (under Windows the MS-DOS-prompt in the Accessories menu) and type

    java -version

If the output is something like

    java version "1.6.0_04"
    Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
    Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)


all is fine, proceed with section 3.b).

Otherwise download the newest Java Runtime Environment for your system (e. g. jre-6u7-windows-i586-p-s.exe) from www.java.com, execute the file and follow the instructions on your screen.

Attention, Linux users: Make sure that the path to the Java interpreter is set into your $PATH environment variable. The Java installer seems not to do that. On my SuSE system I put a line

PATH=/opt/jre1.5.0_06/bin:$PATH

(or wherever you installed the JRE into) into the file /opt/kde3/bin/startkde.

b) Installing FCM

The installation file "fcm.zip" contains the folder "fcm". Unzip this folder to an arbitrary place. That's all.

c) File List

The unpacked fcm.zip file contains the following data:

Folder/File
Description
fcm Program folder.
 +-doc Folder with the program documentation.
 |  +-pics Folder with all pictures.
 |  |  `-*.png
Some images with screen shots of dialog boxes etc.
 |  |-manual_en.html This user manual.
 |  `-manual_de.html The user manual in German.
 +-examples
Folder with some example files.
 |  +-julia.frc
Fractal image with a Julia set.
 |  +-mandel1.clp Clip with a zoom into the Mandelbrot set.
 |  `-*.* Further example files.
 +-lib Java library folder.
 |  `-swing-layout-1.0.4.jar Java swing library.
 +-FCM.jar The FCM application.
 +-startFCM.bat Windows batch file for starting FCM with some example commands. Works with Linux too (errors can be ignored).
 +-mandel.ico A little icon for desktop links under Windows.
 +-mandel.png The same icon for application window decoration.
 `-readme.txt Text file with first hints.

Table A1: FCM program files

4. Program Start

a) Starting out of the "fcm" Folder

Windows User:

Start the program by double clicking the file FCM.jar.

If this does not work (sometimes other programs "hijack" the jar extension and want to unpack the files in it) click FCM.jar with the right mouse button, click "Open With..." and choose the entry "Java(TM) 2 Platform Standard Edition binary" (check the box "Always use this program to open these files" to make the change persistent). Or open a console, navigate into the fcm folder and enter the command

java -jar FCM.jar

Linux User:

Open a shell, navigate into the folder "fcm" and start FCM with the command

java -jar FCM.jar

Hint:
If you see a dialog with a message like "Could not find the main class. Program will exit!" or the message

Exception in thread "main" java.lang.UnsupportedClassVersionError: fcm/FcmMDIApplication (Unsupported major.minor version 49.0)

in your console, then you have an old Java Runtime Interpreter installed. Install the version 1.6.0 or newer as described above.

b) Starting from the Desktop

Windows User:

Linux User (KDE only, I did not try other desktops):

c) Memory for the Java VM

With the commands shown above the Java VM will allocate 64 MB at the most. That is enough for about 120 images in the format 400 x 300 pixel. If you want to allow the VM allocate 512 MB for example you have to start FCM with the following command:

    java -jar -Xmx512m FCM.jar

You will find further examples in the file "startFCM.bat". See also section B.7.d).

5. Your first Fractal Image

Creating a new image
Fig. A1: Creating a new image

When starting FCM you will see a common multi document application with a menu bar, a tool bar etc. For a first impression open the file menu and click the item "New Mandelbrot Image" in it. An empty window will appear, and the "Draw" button will be blinking.


Drawing an image
Fig. A2: Drawing an image

Press the "Draw" button, and a Mandelbrot set will be drawn. The image is put into the image list panel on the right side:
Image Button
Fig. A3: Image button in the image list panel

6. Zoom into the Mandelbrot set

Click the "Zoom" button in the tool bar. A zoom rectangle will appear which can be moved with the mouse or the cursor keys. Its size can be adjusted with the mouse wheel or the "+" and the "-" keys. Give the rectangle a size a little smaller than the window, place it into the middle of the window and press the left mouse button or the return key.

Zoom   
Fig. A4: Zoom into the Mandelbrot set

The Mandelbrot set is recalculated. Repeat these steps several times; each image is put into the image list. Be sure that the "New" button remains pressed while you zoom into the plane (otherwise the actual image is replaced rather than a new one created). You can leave the zoom mode by pressing the "Zoom" button again or by clicking with the right mouse button.

7. Play the Clip

Playing a clip
Fig. A5: Playing a clip

When you have some images in the image list press the "Play" button in the image button panel. All images calculated so far will be replayed in the actual window.

Click the "Endless" check box and play the clip again. Now it will be played endless forth and back.

Click the "Cycle" check box additionally, and the clip is cycled instead. The clip is played till the "Stop" button is pressed.

Type "1000" into the "Delay" field and play the clip again. Now there will be a delay of one second between each image.

8. Draw Julia Sets Picking c-Values

Click menu item "File/New Julia Image" and press the "Draw" button again (compare Fig. A1). Place the two windows side by side and activate the Mandelbrot window by clicking its title bar. Click the "Pick" button, move the mouse into the Mandelbrot window and click somewhere. Doing this you pick the complex value beneath the mouse pointer, and a new Julia set based on this value will be generated. Repeat this several times.
Julia set
Fig. A6: Drawing Julia sets and picking c-values

You can see that the shape of a Julia image depends on the c-value. See chapter C for details.

9. Remove all Images/Load a Clip

Remove images
Fig. A7: Removing all images
Click the "Clear" button in the image control panel. All images will be removed from the image panel and the memory.

Click menu item "File/Open Clip ...". A file select dialog will appear. Navigate to the example folder in the FCM directory and load the clip mandel1.clp. Loading will take a while because all pictures have to be recalculated. Press the "Play" button to play the clip and the "Stop" button to stop it.


Open clip
Fig. A8: Loading a clip

B. FCM in Detail

1. The Main Window

Fig. B1 shows FCM's main window:

Main Window
Fig. B1: Main window

You see a common MDI application (multi document interface) with a desktop and several windows on it, a menu bar, a tool bar, a status panel and on the right side a list with image buttons and some control buttons. These elements and all dialog boxes are described in the following sections.

2. The Menu Bar

The menu bar holds all menus available in FCM.

Menu bar
                Fig. B2: The menu bar

a) The File Menu

The file menu holds all menu items concerning file handling, printing, preferences and lets you exit FCM with saving the preferences.

File Menu
Menu Item
Description
File menu
New Mandelbrot Image Opens a new empty window to draw a Mandelbrot set.
New Julia Image Opens a new empty window to draw a Julia set.
Open Image ...
Opens a file dialog for selecting a fractal image to be loaded from disk.
Between other data the image's pixel size is stored in the file. This size will be restored if there is no empty window open. If there is an empty window open you can let adjust the image size to the size of the window. (But, this works only if the image has not been stored with activated menu item "Save with Colors Array".)
Save Image Saves the actual image to disk. This item is enabled only if the image has been saved already and has a name therefore.
Save Image As ...
Saves the actual image to disk. A file dialog is opened to select a name.
Export Image As ...
Saves the actual image in the PNG (Portable Network Graphics),  BMP (Windows OS/2 Bitmap)  or JPG (Joint Photographic Experts Group) format. A file dialog is opened to select a name. The format depends on the extension (".png", ".bmp" or ".jpg") you give the file.
Export Selected Images As ...
The same as menu item "Export Image As ..." but all selected images in the list are saved. The file name will be automatically expanded by a number between "0000" and "9999" for each image. If your file name is "test0234.png" e. g. the numbers will start with "0234".
Export All Images As ... The same as menu item "Export Selected Images As ..." but all images in the list are saved.
Encode Exported Images to Video ...
Opens a dialog to transform exported images into a MPEG or AVI file. See section B.11 for details.
Open Clip ...
Opens a file dialog for selecting a clip to be loaded from disk. The images are inserted into the image list above the currently activated image.
The clip's pixel size is treated in the same way as the opening of an image: You can let adjust the size to a currently open window.
Open Clip But Export Each Image As ...
Opens a first file dialog for selecting a clip and then a second one for entering the file name of the first image to export.
After calculating each image it will be exported immediately and removed from the image list to get the memory free again. So this is a combination of the menu items "Open Clip ..." and "Export All Images As ..." without holding the images in the image list.
For an explanation see section B.11.e).
Save Selected Images As Clip ...
Saves all selected images to disk. A file dialog is opened to select a name.
Save All Images As Clip ... The same as menu item "Save Selected Images As Clip ..." but all images in the list will be saved.
Save with Colors Array
This is a toggle item which effects the way an image is saved: If active an image is stored with its colors array, if not only its parameters (borders, color settings etc.) are stored (see section B.12). In the second case the files are much smaller, but the colors array has to be recalculated after loading. If your computer is slow or the images are really big you should activate the item.
The item controls also the saving of clips. Be aware that clip files will be really big if this item is checked!
Page Setup ...
Shows your printer's configuration dialog.
Print ... Shows your printer's printing dialog.
Preferences ...
Opens the Preferences dialog box. It is described in chapter B.7.
Restart FCM
Restarts the application. This is necessary if you've chosen a new language setting.
Exit
Leaves the application and saves besides the "preferences" some other parameters as the main window's position and size. These data is not saved if the program is exited by the window closer in the upper right corner.

Table B1: File menu items

b) The Edit Menu

With the edit menu you can manipulate the image list. Single or multiple images can be selected using the Ctrl- or Shift-Keys like files in the Windows Explorer, see section B.4.
Attention: FCM is not able yet to handle the system's clipboard; it is not possible therefore to copy and paste images into other applications.

Edit Menu
Menu Item
Description
Edit menu
Cut Selection
Removes the selected images from the list and copies them to the buffer.
Copy Selection
Copies the selected images into the buffer.
Paste Copied Images
Pastes the images in the buffer into the image list above the topmost selected image.
Paste Copied Images Reversed
Pastes the images in the buffer into the image list above the topmost selected image, but revertes the sequence before doing it.
Delete Selection
Deletes the selected images from the list.
Delete All ...
Deletes all images from the list and the start- and end-image for animations (the last is not done by the "Clear" button in the image control panel).
Remove Key Frame Flag
After creation of an animation the images between the transition was calculated are so called key frames; they are marked with a red triangle. This menu item removes the key frame property.
Select All
Selects all images in the list.
Select Copies
Selects these images again which are actually in the buffer. Useful for restoring a selection.
Select Key Frames
Selects all so called key frames which are built while creating an animation.
Invert Selection
Selects all images not selected at the moment and vice versa.
Goto Next Image
Selects and activates the next image in the list. All other images are deselected.
Goto Previous Image
Selects and activates the previous image in the list. All other images are deselected.
Goto Next Selected Image
Activates the next selected image in the list. The selection remains unchanged.
Goto Previous Selected Image
Activates the previous selected image in the list. The selection remains unchanged.
Go To Next Key Frame
Activates the next key frame in the list. The selection remains unchanged.
Go To Previous Key Frame Activates the previous key frame in the list. The selection remains unchanged.
Goto Image ...
A dialog pops up to enter an image no. When leaving it with OK this image will be activated. A selection remains unchanged but this image will be added to the selection.

Table B2: Edit menu items

c) The Animation Menu

The animation menu holds all menu items for creating animations automatically. See section B.10 for details creating animations.

Animation Menu
Menu Item Description
Animation Menu Parameters ... Opens the Animation Parameters dialog box. It is described in chapter B.10.
Adjust Frame Rate ...
If you want to create an AVI file out of an animation (see section B.11.)  you have to set how many images per second the video should have. If you change the frame rate, the number of pictures between to key frames have to change also, of course. (At least if the time distance between the key frames should remain the same.) Here you can adjust the frame rate of all selected key frames to the value that is placed in the Video Creation Dialog.
More precisely: The number of images between the selected key frames will be recalculated in a way, that the time difference between them remains the same, but the new frame rate can be used when creating an AVI file.
Calculate Animation
Calculates a smooth transition between all selected images. See section B.10 for details.

Table B3: Animation menu items

d) The Help Menu

The help menu lets you access the manual and shows version infos.

Help Menu
Menu Item Description
Help Menu Contents
Opens the manual page in your web browser. In Windows your registry is scanned to detect your default browser, in Linux Firefox is used. These settings can be changed in the preferences dialog box, see section B.7.
About
Opens the about dialog box with version infos, the license and some system properties.

Table B4: Help menu items

3. The Tool Bar

Toolbar
Fig. B3: The tool bar

The most important functions you can execute with the buttons in the tool bar.

Button
Description
Draw
Draws a fractal image into the actual window using the actual settings.
Zoom
Opens a zoom rectangle which marks a cutting in the actual window. There are the following commands:
  • Mouse move or cursor keys: Moving of the cutting.
  • Left mouse button or Return: Activating and drawing the cutting.
  • Mouse wheel or "+"- and "-"-key: Change the rectangle's size.
  • Middle mouse button or "0"-key:  Sets the rectangle to the same size as the window is; this may be used for moving the plane rather than zooming.
  • Right mouse button or ESC: Leaving the zoom mode.
Pick
This item is only enabled if at least one Julia window is open and a Julia image is drawn in it. A click with the left mouse button picks up the complex value beneath the mouse pointer and draws a new Julia set using this value as "c"-parameter immediately. If your active window holds a Mandelbrot set the Julia set is drawn into the last active Julia window. The commands are nearly the same as above:
  • Mouse move or cursor keys: Moves the cursor.
  • Left mouse button or return: Chooses the value and draws a new image.
  • Right mouse button or ESC: Leaves the pick mode.
Data
Opens the Geometry dialog box. It is described in section B.8.
Colors
Opens the Colors dialog box. It is described in chapter B.9.

Table B5: Tool bar items

4. The Image Button Panel

Image button panel
Fig. B4:
The image list
The image button panel shows all images calculated so far. You can think of the image list as a stack: The oldest image is at the bottom, a new image is put on top of it.
The image indicator at the bottom shows how many images are in memory and which of them is activated (in the example on the left 18 pictures are in memory and the 16. is activated).

Single or multiple images can be selected like files in the Windows Explorer [see also section B.2.b)]:
  • A single image is selected by clicking it with the mouse.
  • A second image is selected by clicking it with the mouse and holding down the Ctrl key.
  • Multiple images are selected with the mouse while holding down the Shift key.
While the "New" button is selected, drawing an image results in a new image. If the "New" button is not selected the actual image is replaced by the drawn image instead.
When animations are created so called key frames arise. These are marked with a red triangle in the upper left corner.

5. Image Controls

With the image control buttons you can scroll through the images in memory, move them up and down, delete and copy them. Furthermore the images can be played as a clip.

Panel
Control Element
Description
Image Controls Next
The next image is displayed. (Shortcut "D".)
Prev
The previous image is displayed. (Shortcut "C".)
Up
The actual selection is moved up one position.
Down
The actual selection is moved down one position.
Del
The actual selection is deleted from the list (and memory).
Clear
Removes all images from the list and the memory.
Play
The actual selection is played as a clip. If only one image is selected all images are played beginning with the selected one.
Attention: Since the colors are recalculated when displaying an image, and this procedure needs time, your images should not be too large to achieve a high frame rate.
Stop With this button all long enduring operations can be interrupted. E. g. playing a clip, loading a clip, drawing an image.
Cycle
If this check box is checked a clip is cycled, i. e. the first image is displayed again after the last or vice versa. The direction is determined by the direction the clip is actually running when you check the box.
Endless
If this check box is checked the clip is played endless forth and back. If the "Cycle" check box is checked additionally the images are cycled.
Delay/ms
This element is used to set a time delay between two images when playing a clip. For smooth animations set it to 0, if you want to display a slide show you may set it to 2000 e. g. to display the next picture after 2 seconds.

Table B6: Image control elements

6. The Status Panel

The status panel shows the most important parameters of an image. The leftmost four entries show the borders of your image, i. e. the borders of the complex plane your image is painted into. Because a Mandelbrot set shows the c-plane they are labeled with "crMin" etc. A Julia set shows the z-plane, therefore the labels are "zrMin" etc.

Status Panel Mandelbrot Set
Fig. B5: Status panel (Mandelbrot set)

Status Panel
Fig. B6: Status panel (Julia set)

Also you can see the actual mouse pointer's coordinates and the number of iterations the iteration process has needed to calculate the color of that point. These data is displayed in the rightmost three fields.

Julia sets show additionally the value of the constant c in the fields "cr" and "ci" used for calculating that image.

7. The Preferences Dialog

This dialog can be reached with menu item "File/Preferences ...".

Preferences dialog

Fig. B5: Preferences dialog

a) Section "Help Browser"

In this section you can adjust the help browser path. If the check box "Use Default Browser" is checked, and FCM is running under Windows, your registry is checked for your default browser; under Linux Firefox is used. If this does not work or you want to use another HTML browser you can choose your favourite one with the "Search" button.

b) Section "Language"

For the time being you can use FCM with two languages, English and German. Since all texts are to be reread in case of a language change, FCM has to be restarted with "File/Restart FCM" to take effect.
With the setting "Default" FCM starts in the language of your desktop.You can override this default language by starting FCM from a command line with
    java -jar -Duser.language=de -Duser.country=DE FCM.jar
or
    java -jar -Duser.language=en -Duser.country=GB FCM.jar

c) Section "Skin"

In the third section the skin (look and feel) of the application can be adjusted. FCM's layout is optimized for the MS Windows skin, the layout is rather poor with Motif. Unfortunately the MS Windows skin is not available in the Linux version of the Java Runtime Environment.
The list of skins is generated dynamically by retrieving the installed Java look-and-feels.

d) Section "Others"

In the last section you can adjust these settings:

The options are saved to the file fcm.ini in your home directory only when leaving FCM with the "File/Exit" or "File/Restart FCM" menu items. This file is not written if leaving the application with the window closer, and your changes will be lost in this case.

8. The Image Geometry Dialog

This dialog can be reached with the button "Data" in the tool bar.

Geometry dialog

Fig. B8: Image geometry dialog

With the image geometry dialog you can adjust the image geometry parameters. It is divided into four panels and the button group:

a) Section "Image Size"


b) Section "Borders"

These four elements let you adjust the mapping of the window into the complex plane. crMin is the plane's left border, crMax its right (real axis), ciMin its bottom and ciMax its top (imaginary axis). Since the aspect ratio of a pixel is fixed to 1:1 you are not free in choosing arbitrary values for ciMin or ciMax: At least one of this is calculated automatically depending on the auto adjust check box. If both are checked the top and bottom borders are calculated so that the middle of the vertical axis will remain as it has been.
Normally you will not enter values here by hand but change the image by zooming or moving it directly with the mouse.

c) Section "Max. Iterations"

As you can read in section C.3 the iteration which is calculated for each pixel may never come to an end. You can configure here the number of iterations which will be calculated at the most. If this number is exceeded the procedure terminates (and the pixel will go black).
It is not easy to find an optimal value for this maximal number: High values will lead to long calculation times, low values will cause "unsharp" images:

Unsharp
Fig. B15: Unsharp image, 1600 iterations
Sharp
Fig. B16: Sharper image, 5600 iterations

A thumb rule (for Mandelbrot sets) is: When zooming into the complex plane the number should become greater. This rule is performed by the auto adjust check box. Especially for regions in the "fissure" of the Mandelbrot set (Fig. B15 and B16 are from that region) and for Julia sets you may correct this auto setting by your own inputs. Julia sets often needs higher values to avoid large black regions which are not really black.
The automatic can be influenced with the field "Multiply By": The value calculated automatically will be multiplied with this value, and the result is used for calculating the images.

d) Section "Constant c"

If the active window shows a Julia set its c-value is displayed here and may be altered. This can be done more comfortable with the "Pick" button in the tool bar.

e) Buttons


9. The Image Colors Dialog

This dialog can be reached with the button "Colors" in the tool bar.

Colors dialog

Fig. B17: Image colors dialog

The image colors dialog lets you change the color mapping of your fractal image. Let's have a closer look at the data FCM generates while calculating an image. As described in section C.3 the complex plane is scanned pixel by pixel, and for each pixel the iteration is performed. FCM stores the number of iterations needed for |zn| to become greater than 2.45 (square root of 6) in a two-dimensional array of the same size as the image. Each value in this array is mapped to a color, and the corresponding pixel in your image will be set to this color. The mapping from value to color can be manipulated here.

You see, there is a dependency to the maximal allowed iterations described in the previous section. Say, we have in maximum 200 iterations, then we have obviously 200 different colors at the most! (May be even less because you could display a region of the complex plane where the iteration terminates for all pixels before 200 iterations are reached for one of them.)

a) Section "Number of Colors"

Think, we look at a region of the complex plane where all 200 values of iterations are available, and the image could show 200 different colors therefore. Nevertheless we may wish not to use all 200 colors, because we like to see an image with only two colors e. g. This can be adjusted with the slider "Number of Colors" if the "manual setting" radio button is active. Be aware that the maximal choosable value depends on the "max. Iteration" setting described in the previous section B.8.
In Fig. B17 there is a value of 40. This means, that a pixel with an iteration number of 41 will have the same color as a pixel with iteration number 1, with 42 the same as with 2 and so on.

If you play around a little with FCM and zoom into the Mandelbrot set you will see that your images are better if you don't use always the same fixed number of colors. Therefore FCM tries to find a good choice by itself depending on image parameters if one of the auto modes is on.

The first ["auto (count iterations in image)"] counts the number of different iteration numbers in the image.
Example: Say there are some pixels with 10 iterations, other pixels with 20 iterations and all the rest have 200. Then the number of iterations is 3, more colors are not necessary (and possible), and FCM sets the number of colors to this value. Zoom clips into the Mandelbrot set tend to have a color flickering in this auto mode.

The second ["auto (use max. iterations)"] uses the image property "max. Iterations" (see Fig. B8). This value may change automatically when zooming in depending on your settings.

Third the automatically derived number of colors is always modified by the number given in the field "reduce number of colors by divisor"). Experiment with these values to get colors you like!

b) Section "Color Gradient Editor"

The color gradient editor is the most powerful tool to adjust the images to the own imagination. Above we have seen that there is a mapping from iterations to colors. But what iteration value corresponds with what color? That is controlled with the color gradient and the two sliders "Smallest Color" and "Biggest Color".

At first you should create a color gradient containing the wanted colors. A color gradient can be changed by adding, deleting and changing the round color sliders. In fig. B17 the color gradient consists out of five colors (green, red, yellow, blue and white) having the same distance from each other e. g.

The functions of the editor are as follows:

The color gradient of an image will be stored together with an image and it is not necessary to store it seperately.

Now we have a color gradient, but the mapping between a pixel's number of iterations and its color is still not clear. This can be assigned with the to sliders '"Smallest" Color' and '"Biggest" Color'. In Fig. B17 the '"Smallest" Color' slider stands at the green position. That means: All pixels with an iteration number of 1 become green. The '"Biggest" Color' slider stands at the white region, and the "Number of Colors" is 40. That means: A pixel with an iteration number of 40 will become white. All color values between 1 and 40 are spread evenly over the color gradient between the two sliders. A pixel with iteration value 41 has the same color as a pixel with value 1 and so on. If the '"Smallest" Color' slider stays behind the '"Biggest" Color' slider the colors are wrapped around. You can see this easy if you choose "Number of Colors" as 2 and play with the sliders: Only the two colors the sliders are set on will be in the image.

Attention: Pixels with color value = max. iterations are always black. This color can not be changed.

c) Further Control Elements


10. The Animation Parameters Dialog

This dialog can be reached with menu item "Animation/Parameters ...".

Animation parameters dialog

Fig. B18: Animation parameters dialog

As we have seen in section A.6. you can generate animations by creating each single image by hand. This is rather awkward. Therefore you can select some images (two at least) from the image button panel, and FCM will calculate a smooth transition between them automatically. How this is done you can influence with the animation parameters dialog.

a) First and Last Image

In this panel the start and end image of the first selected image pair are shown. The check boxes "Smooth Movement" cause the calculation of additional images at start and end of the transition, therefore the movement seems to be slower. So you have a smoother transition from one pair to the next.

b) Settings

In this panel all parameters FCM is able to modify while calculating an animation are listed (with the exception of changes in the color gradient; such a transition you can not influence). If a parameter does not differ in the start and end image the spinner element is grayed, its entry is set to 0, and it is not changeable. In Fig. B18 you can see a zoom into the Julia plane e. g. The first entry in the resize spinner says to reduce the width of the image by 8 percent each image. This will result in 36 images as stated in the last line. Of course this depends on the sizes of the start and end image.
All parameters are influencing each other: If you change the resizing percentage, this will result in a change of the image number, and this results in a change of the other parameters. Try it out.
Hint: This will only work if the spinner you are modifying has the focus. Unfortunately the Java Swing spinner element used here is buggy (JRE 1.6) and does not have the focus even if the cursor blinks in it! Therefore FCM sets the focus per program code when the mouse enters the spinner. To indicate this the label's color is changed to blue. Only in this state the update mechanism is working! This means that you can not modify the entries reasonably  with the keyboard, the mouse is necessary, I'm sorry.

GUI Element
Description
Duration/ms
In this field you can enter the duration (in milliseconds) the transition between the start and end image should have.
For an animation played inert FCM this value has no meaning. It is important only if you want to create an AVI file out of it. And even then the duration is the result of the number of images (the last field in the dialog) and the frame rate given in the video creation dialog only.
What is the field good for then? It is needed in the following situation:
You want to add music to an animation, and according to the rhythm the transitions should take place. Now you need a well defined duration for each transition. If you know the frame rate that the AVI file will have you can easily calculate the needed number of images of a transition to get the wanted duration of course. Oafishly if you want to change the frame rate: Then you have to step through all transitions and to adjust the number of images. Therefore you can remember the duration in this field. This value will be used only with menu item "Animation/Adjust Frame Rate ...". This menu item gets the frame rate out of the video creation dialog and adjusts for all transitions the number of images so that the duration for the transition remains the same.
Frames per Second
For this field the same as for the field "Duration/ms" is true: It is only of interest when creating AVI files. It helps you to avoid mental arithmetic when you want to get the duration, the frame rate and the number of images together.
Resize each image by
This spinner is enabled if the start image differs in size from the end image. You can enter here the percentage from the actual image width the next picture will differ in size from the current picture.
Move each image by
This spinner is enabled if the start image differs in position from the end image. The position may differ in its horizontal or  vertical position. The average is calculated, this results in a constant. Each image is moved in horizontal and vertical direction by the percentage of that constant.
Change max. number of iterations by
This spinner is enabled if the max. iteration number differs between start and end image and at least one of them is not set to "auto adjust" (see section B.8). Since this entry should differ between start and end image only in case of  zooming into the plane, and then it should increase logarithmically, the value you can enter here is the percentual change to the next image rather than an absolute value.
Change Julia constant cr by
This spinner is enabled if the real part of the Julia constant c differs between start and end image. The difference is calculated by FCM, and you can enter here a percentage of this difference. This results in a constant value each new image will differ from its predecessor.
Change Julia constant ci by Same as above.
Change number of colors by
This spinner is enabled if the number of colors differs between start and end image and at least one of them is not set to an "auto" mode (see section B.9). The value you can enter here is the percentage of the actual color number the next image will differ from the current one.
Change "Smallest" Color by
This spinner is enabled if the '"Smallest" Color' differs between start and end image. The following four cases are to distinguish:
  • The start value is lesser than the end value and you increase the value each step => the value moves forward from start to end each step:

       0           start          ->           end         10000
       |-------------|--------------------------|------------|

  • The start value is greater than the end value and you increase the value each step => the value moves forward from start to end each step, but wraps around when reaching the max. value of 10000:

       0     ->     end                       start   ->   10000
       |-------------|--------------------------|------------|

  • The start value is lesser than the end value and you decrease the value each step => the value moves backward from start to end each step, but wraps around when reaching the min. value of 0:

       0     <-    start                       end    <-   10000
       |-------------|--------------------------|------------|

  • The start value is greater than the end value and you decrease the value each step => the value moves back from start to end:

  •    0            end           <-          start        10000
       |-------------|--------------------------|------------|

In the spinner the absolute value for each step can be entered. To order FCM to move backward enter a negative value.
Change "Biggest" Color by Same as above.
Results in
This spinner is always enabled. Enter the number of images the animation will consist of here. Making changes will alter all other parameters of course.

Table B7: Animation parameters

Hint: The key frames contain the complete information to create an animation. Therefore it is sufficient to store the key frames to disk only, the animation can be restored completely by recalculating it again.

Tip: Especially with clips of Julia sets you have to experiment with the parameters a little and recreate images often. This takes a lot of calculation time with larger images. Therefore it is better to create a clip with small images and save it when finished. When loading again you can adjust the size to an arbitrary size by opening an empty window with the wanted size first.

11. The Video Creation Dialog

This dialog can be reached with menu item "File/Encode Exported Images To Video...".

Video Creation

Fig. B19: Video creation dialog

a) Concept of Video Creation

Creation of MPEG- or AVI video files is a complex procedure, FCM is not able to do it without a further software.
You have to perform the following steps:
There are some free applications to convert single images into a video known to me:
MEncoder supports most image formats and has the biggest functionality, therefore FCM supports video creation with this application by means of the video creation dialog; it is graphical user interface allowing you to feed the most important parameters into MEncoder's video creation console application.

So download the file "MPlayer-mingw32-1.0rc2.zip" (or newer) from http://www.mplayerhq.hu/design7/dload.html and unpack it at an arbitrary place (nearly arbitrary: the path must not contain spaces!). The folder "MPlayer-1.0rc2" will be created, in this folder are the two files "mencoder.exe" und "mplayer.exe"; FCM will use theses console applications to create and to play videos.

b) Section "Files And Folders"

The most important section is "Files And Folders"; when all settings are done here, the remainder of the dialog are filled automatically with default settings. Changes are only needed if wanted.

GUI Element
Description
Input File Type
MPlayer is able to handle various image formats. Enter the type you have exported your images into, BMP, PNG or JPG.
Inpput File Folder
This is the folder you have exported your images into.
Audio File
If you want to hear some music while playing the clip choose an audio file here. MEncoder will mux it into the video stream.
Output File
Give place and name of your video file here.
MPlayer Folder
FCM needs to know where your MEncoder is. Give the folder here where the file "mencoder.exe" is in.

Table B8: Section "Files And Folders"

c) Section "Video Settings"

In this section you can provide MEncoder with some parameters. The most important ones are available with drop down lists.

GUI Element Description
Video Codec
Used for selecting the video codec. Which is best depends on the videoplayer you are using. The Windows Mediaplayer is best satisfied with "msmpeg4v2".
Audio Codec
The same is true as for the video codec. Use "copy", "mp3lame" or "pcm" for Windows Mediaplayer compatibility.
kBits per Second
MEncoder can adjust the data rate steplessly, some standard presets are in the drop down list. As higher the data rate is as higher is the video quality, but as bigger is the resulting video file. Experiment to find the best agreement.
General Options
This field is for general parameters for the MEncoder if you want to set one or another. See the MEncoder documetation.
Codec Options
Here some parameters are given concerning the video codec. You could use "General Options" instead, the field is there only for the sake of clarity.
Frames per Second
Here is also true: As higher the frame rate as higher is the video quality (a cinema movie has 24 images per second, in TV there are 25), but as bigger will be the video file. And, last but not least your video is shorter!
15 frames per second are a good compromise.

Table B9: Section "Video Settings"


d) Section "Create And Play Video"

These settings will be normally filled by FCM automatically when settings in the other sections are made. Change these settings only if wanted (e. g. if you want to use another application instead of MEncoder) and do not change the settings above anymore because these changes will override your settings here again.

The principle is: FCM creates a batch file "enc.bat" when the button "Create Video" is pressed. This file contains all commands and parameters needed for encoding your images into a video and will be executed then via the system console.
In the same way a batch file "play.bat" is created and executed when the button "Play Video" is pressed.

GUI Element Description
Shell Command
This is the command for starting a console shell and executing a batch command. Don't change this under Windows; under Linux you could enter your favourite shell here.
Encoding Batch File
Here you can see the content of the batch file "enc.bat" which is created when pressing the "Create Video" button. The batch program changes into the directory with your exported images first and executes MEncoder with all settings given in this dialog then.
Playing Batch File
The same as "Encoding Batch File", but this is the file for playing the created video, executed when the "Play Video" button is pressed. The most important MPlayer commands while playing are:
  • Left: -10 seconds
  • Right: + 10 seconds
  • Down: - 1 minute
  • Up: + 1 minute
  • Backspace: normal speed
  • {: half speed
  • }: double speed
  • F: Full screen
Encode Command
This is the command for starting "enc.bat".
Play Command
This is the command for starting "play.bat".
Close Console Window After Executing Command
When encoding or playing a video a console window opens executing the batch file. The window remains open afterwards to let you see error messages etc. This is cumbersome when you have adjusted all parameters and you are not interested in the messages any longer. So check this box, and the console window will be closed after executing the command.

Table B10: Section "Create And Play Video"

e) Tips for Creating High Quality Movies

Clips like to consist out of some thousend images which can be hold in memory only if they are small (e. g. 200 x 150 pixels). But, to create an AVI file in good quality out of these you need the exported images in a bigger format (e. g. 800 x 600 pixels). If you want to improve the quality by scaling down the images while exporting (see section B.8.a)) even bigger formats are recommended (e. g. 1600 x 1200 pixel). Of course you could split your clip into parts and calculate and export them one after another. But using menu item "File/Open Clip But Export Each Image As ..." is much more comfortable:
=> Each image of the clip will be calculated in the big format now, exported immediately (scaled down when indicated) and removed from the image list then. Only the last image will remain in the image list at the end, and all images are on the hard disk as *.bmp files.
The exported images can be converted to an AVI file now as described above.

12. Some Technical Aspects

To generate a fractal image three kinds of data are involved:

First there are the image parameters. These are the parameters you can adjust in the parameter dialog boxes (see Figs. B8 and B9). They are sufficient to describe an image completely and to calculate the image. Only these parameters are stored to disk if menu item "File/Save with Colors Array" is not checked.

Second there is the array of iteration numbers. It is a two-dimensional array of 32-bit-values. In this array for each pixel is stored how many iterations are necessary to exceed the border of 2.45 for |zn| (see chapter C for details); this value corresponds with a color value, but it is not the 24-bit-true-color-value you will see in the image window. The array is stored in main memory for each image in the image list. If menu item "File/Save with Colors Array" is active the array is stored to disk additionally to the image parameters.

Third there is the true color image you can see in the image windows. This image is calculated out of the array of iteration numbers by using the color parameters each time an image of the list is activated. It is not stored with an image (it is owned by the window and not by the image). When playing a clip the same happens: The true color image has to be recalculated out of the iterations array for each single image. You can imagine that this colorizing process needs time! But, it saves memory, and therefore you can hold more images in the list, and a clip can be longer.

All images are held in the main memory, no hard disk space is used.

Conclusion: If your computer is slow you should generate clips with smaller images to speed up the frame rate. May be it's better to activate the menu item "File/Save with Colors Array".

13. Example: Optimizing an Image

The following example shall show how to create high quality images with FCM in an efficient way. Restart FCM to ensure all Parameters are set to their defaults.

The most important rule while creating images with FCM is:

    Work with images as small as possible!

The calculation of fractals is very computationally intensive, as larger the images are as slower is FCM. On my Pentium M 1500 a size of 400 x 300 Pixels is a good choice (this is why this size is the default value). Only as the last step, when all parameters are set as wanted, you should create a big image which is to be saved as JPG file e. g. But, as long as you have to screw at the parameters a lot, it's not bad to use even smaller images, therefore the following examples have a size of 200 x 150 Pixels only.

The first step is always to search for an interesting region in the c-plane. Let's have a look into the fissure between "head" and "body" of the Mandelbrot set; after some zooms we find a promising place, a structure like a jellyfish:

Zoom into the Mandelbrot set

Fig. B20: Zoom into the Mandelbrot set searching an interesting region

You see in the last image still large black regions which are not "Mandelbrot like"; presumebly the maximal number of iterations chosen by FCM is not big enough. Open the geometry dialog (button "Data" in the tool bar) and increase the maximal number of iterations from about 650 to 2000, the black regions will vanish:

Medusa mit 2000 Iterationen

Fig. B21: Maximal number of iterations increased to 2000

 But, the colors are rather boring now, because the number of colors is increased too since it is linked with the number of iterations. Such spiral regions appear especially interesting when choosing the number of colors so that the colors are repeated in each spiral cycle. This we can achieve in the color dialog (button "Colors" in the tool bar) with the slider "Number of Colors".

Color gradient "FCM"

Reduction to 63 colors

Fig. B22: Color gradient "FCM", number of colors reduced to 63
Color gradient "Spectrum", modified

Jellyfish with new color gradient

Fig. B23: Color gradient "Spectrum (b/w)", modified (white color removed, all colors moved to the left a little)

In fig. B22 the number of colors is reduced to 63, but, the colors are somewhat pale. The color gradient "Spectrum (s/w)" is a little more colorful. It appears even better if you remove the white color from the gradient and move all colors to the left a little until the image gets a dark background, the colors are more shiny then (fig. B23).

A little unattractive are the clear color gradations. Unfortunately FCM can not do it better, there is the Fractalizer with its "fine gradations" more advanced [perhaps I can figure out some day how they do it :-)]. But you can take advantage of the Mandelbrot set's self-similarity and look for a similar region with more gradations. So, look for the next smaller version of the Mandelbrot set on the "antenna", zoom to the same place between head and body and adjust the colors in an appropriate way.

Mandelbrot set on the antenna

Fig. B24: Smaller Mandelbrot set on the mother's "antenna"

At last is to decide how big the finished image should be, e. g. 400 x 300 Pixels. Supersampling is not appropriate here because of the small number of colors (try it), therefore we use "downscaling" for quality improvement.
To do this open the image geometry dialog and push the "x 2" button three times. When leaving the dialog with OK a new empty window with the size of 1600 x 1200 pixels is created. Draw the picture again now (button "Draw" in the tool bar as usual).
In the preferences dialog (menu item "File/Preferences ...") enter in the drop down list "Downscale Image When Exporting to" the value 25 % and leave the dialog. Now save the image with "File/Export Image As ...".

Endbild

Fig. B25: Finished image, downscaled to 400 x 300 Pixel

C. Short Introduction into the Mathematical Aspects

The following sections give a (very) little background information on the techniques used for generating the fractal images.

1. Iterations

If you calculate an iteration, you do the same procedure several times and use the result of that procedure as input for the next. E. g. you could decide to add a constant to a number repeatedly. Say, your first number is 0, and your constant is 1.2. You will get the sequence 0, 1.2, 2.4, 3.6, ... and so on. Let us write it a little more formal:

r0 = 0
r1 = r0 + 1.2 =   0 + 1.2 = 1.2
r2 = r1 + 1.2 = 1.2 + 1.2 = 2.4
r3 = r2 + 1.2 = 2.4 + 1.2 = 3.6
...

And shorter:

r0 = 0, c = 1.2
rn = rn-1 + c

You may do this iteration as long as you want to stop, e. g. if rn has reached a value greater than 4.

Look at the following little different iteration formula as another example:

r0 = 0, c = 1.2
rn = rn-12 + c

In other words: Choose as start value 0 and as constant 1.2 again. To calculate the next value square the predecessor and add the constant.
This results in the following sequence as you easy can compute: 0, 1.2, 2.64, 8.17, ...
If we choose c = 0.5 the sequence is: 0, 0.5, 0.75, 1.06, 1.63, 3.15, 10.44, ...
If we choose c = -2 the sequence is: 0, -2, 2, 2, 2, 2, ...

We state as an interesting result: In the first case the fourth number (8.17) is greater then our limit 4, in the second case the seventh number (10.44) is greater than 4, in the third case we never reach our limit 4! This depends obviously on the constant c and/or the start value r0.

How could we visualize this result? We give each number a color (e. g. 4 = green, 7 = red, never = black) and draw a point of this color for each c-value onto an axis:

Axis

Fig. C1: Real axis with c-values

On this picture the dots say immediately to us:
"Hello, I am the c-value -2, and I never reach your limit, therefore I am black."
"Hello, I am the c-value 0, and I need 4 iterations to reach your limit, therefore I am green."
"Hello, I am the c-value 0.5, and I need 7 iterations to reach your limit, therefore I am red."

2. Complex Numbers

To understand what can be seen in the fractal pictures generated by FCM you need a little imagination what complex numbers are. Complex numbers are an extension of real numbers. As you may remember real numbers are the combination of rational (the set of all fractions) and irrational (algebraic and transcendent) numbers. But real numbers have a disadvantage: You can not get roots of negative numbers because the product of two negative numbers is always a positive number [what could be the root of -2? No, -1.41*(-1.41) results in +2!]. Complex numbers overcome this by introducing the "imaginary unit" i, which is defined to be the root of -1, or in other words i2 = -1.

A complex number z has the form z = a + bi with real numbers a and b. a is the real part and b is the imaginary part of z. Important for us are three aspects:
  1. A complex number can be drawn as a point into the so called complex plane.
  2. There are rules to calculate with complex numbers, especially you can add and multiply them.
  3. A complex number has a distance from the origin in the complex plane.

a) The Complex Plane

As an example let's look at a complex number z1 = 3 + 2i. You can locate this number in a Cartesian coordinate system at position (3, 2). The horizontal axis is used to display the real part, the vertical axis the imaginary part of the number:

complex plane

Fig. C2: The complex plane

Also you can see in Fig. C2 the absolute value (distance from z1 to the origin), it is signed with |z1|, and another complex number z2 = 2 - 1i.

b) Calculation Rules

How do you calculate with complex numbers? This is as easy as with normal real numbers; just keep in mind that i*i = -1. We need only to multiply and to add complex numbers for our iteration described below. The rules for these operations with a complex number z1 = a + bi and another z2 = c + di are:

Addition:       z1 + z2 =  a+bi +  c+di
                        =  a+c  + (b+d)i

Multiplication: z1 * z2 = (a+bi)*(c+di)
                        = a*c + a*di + bi*c + bi*di
                        = a*c + a*di + bi*c + b*d*i*i
                        = a*c + a*di + bi*c + b*d*(-1)
                        = ac-bd + (ad+bc)i

And the absolute value is defined to be:
        _____
|z| =  roota2+b2

As an example let's multiply the numbers of Fig. C2: z1 = 3+2i and  z2 = 2-1i:

z1 * z2 = (3+2i)*(2-1i)
        = 3*2 - 3*1i + 2i*2 -2i*1i
        = 6 - 3i + 4i - 2i*i
        = 6 + i + 2
        = 8 + i

And the absolute value of z1 is for example:
        _______   ___
|z1| = root32 + 22 = Root13 = 3.61

[For the sake of completeness: The complex roots of -2 are (0 + 1.41 i) and (0 - 1.41 i), because
-1.41 i * -1.41 i = 1.41 i * 1.41 i = 2*i2 = -2.]

3. The Mandelbrot Set

Let's look at an iteration with complex numbers. We could use the same iteration formula as in section C.1 with a complex start value z0 and a complex constant c, e. g.:

z0 = 0 + 0i, c = -1.3 + 0.8i
zn = zn-12 + c

In the same way as above we can ask "how many iterations we will need till the absolute value of zn is greater than 4?". And this is what you can see in a Mandelbrot picture generated by FCM! (To be exactly: The limit is 2.45 instead of 4.)

In such a picture you can see the complex plane, each point of it is interpreted as a different c-value. The plane is scanned point for point and line for line, and the iteration is calculated for each point (= c-value). Each point delivers the number of how many iterations are necessary to get an absolute value for z greater than 4. Each number is associated with a color, and the pixel corresponding to the c-value is painted in this color.

Now there are some points for which the absolute value will never become greater than 4. These points are colored with black, and all of these points are the Mandelbrot set:

Mandelbrot set

Fig. C3: Mandelbrot set

All black points build a characteristic shape as you can see in Fig. C3. The shape's crumpled boundary is a typical fractal structure: If you take a magnifying glass and look more closely at it, you will find that it looks exactly as crumpled as without the glass. Try it out by zooming into the plane with FCM. You will discover a universe of bizarre structures, and all comes out of that simple iteration!

By the way, the set is named after Benoit B. Mandelbrot, a Polish-American mathematician.

4. The Julia Set

The Julia set is built by the same iteration formula as the Mandelbrot set. The difference is: You don't see the c-plane but the z-plane, and the constant c is fix for all calculated points.

That means: An arbitrary complex constant c is chosen. Then the complex plane is scanned, again point by point, line by line. Each point is interpreted now as the start value z0 and not as c. The iteration is performed exactly as in the Mandelbrot set. Of course, the result is different and depends on the chosen value c:

Julia set

Fig. C4: Julia set, c = -0.8 + 0.2i

The Julia set has its name from the French mathematician Gaston Julia.

D. Appendix

1. Known Bugs


2. Known Shortcomings


Error reports and suggestions for improvement are highly welcome. Please, write to fs@friedemann-seebass.de.

3. Change Log

4 June 2006: V.0.80:

2 July 2006: V.0.90:

2 August 6 2006: V.1.00:

13 August 2006: V.1.10:
31 January 2007: V.1.20:
11 February 2007: V.1.30:
26 October 2008: V.2.00:
20 March 2009: V.2.10:
5 February 2010: V.2.11:
27 February 2010: V.2.12:

4. Other Fractal Generators

There are some other free fractal generators available in the net which I like: