Fractal flame
From Wikipedia, the free encyclopedia
Fractal flames are a member of the iterated function system class[1] of fractals created by Scott Draves in 1992.[2] Draves' open-source code was later ported into Adobe After Effects graphics software[3] and translated into the Apophysis fractal flame editor.[2]
Fractal flames differ from ordinary iterated function systems in three ways:
- Nonlinear functions are iterated instead of affine transforms.
- Log-density display instead of linear or binary (a form of tone mapping)
- Colour by structure (i.e. by the recursive path taken) instead of monochrome or by density.
The tone mapping and coloring are designed to display as much of the detail of the fractal as possible, which generally results in a more aesthetically pleasing image.
Contents |
[edit] Algorithm
The algorithm consists of two steps: creating a histogram and then render the histogram.
[edit] Creating the histogram
First one iterates a set of functions, starting from a randomly chosen point P = (P.x,P.y,P.c), where the third coordinate indicated the current color of the point.
- Set of flame functions:

In each iteration, choose one of the functions above where the probability that Fj is chosen is pj. Then one computes the next iteration of P by applyingFj on (P.x,P.y).
Each individual function has the following form:
where the parameter wk is called the weight of the variation Vk. Draves suggests [4] that all wk:s are non-negative and sum to one, but implementations such as Apophysis does not impose that restriction.
The functions Vk are a set of predefined non-linear functions. A few examples[4] are
- V0(x,y) = (x,y) (Linear)
- V1(x,y) = (sinx,siny) (Sinusodial)
(Spherical)
The color P.c of the point is blended with the color associated with the latest applied function Fj:
After each iteration, one updates the histogram at the point corresponding to (P.x,P.y). This is done as follows:
histogram[x][y][FREQUENCY] := histogram[x][y][FREQUENCY]+1 histogram[x][y][COLOR] := (histogram[x][y][COLOR] + P.c )/2
The colors in the image will therefore reflect what functions that was used to get to that part of the image.
[edit] Rendering an image
To increase the quality of the image, one can use supersampling to decrease the noise. In this case, creating a histogram larger than the image so each pixel has multiple data points to pull from.
For example, creating a histogram with 300×300 cells in order to draw an 100×100 px image. Each pixel would use a 3×3 group of histogram buckets to calculate its value.
For each pixel (x,y) in the final image, do the following computations:
frequency_avg[x][y] := average_of_histogram_cells_frequency(x,y); color_avg[x][y] := average_of_histogram_cells_color(x,y); alpha[x][y] := log(frequency_avg[x][y]) / log(frequency_max); //frequency_max is the maximal number of iterations that hit a cell in the histogram. final_pixel_color[x][y] := color_avg[x][y] * alpha[x][y]^(1/gamma); //gamma is a value greater than 1.
The algorithm above uses gamma correction to make the colors appear brighter. This is implemented in for example the Apophysis software.
To increase the quality even more, one can use gamma correction on each individual color channel, but this is a very heavy computation, since the log function is slow.
A simplified algorithm would be to let the brightness be linearly dependent on the frequency:
final_pixel_color[x][y] := color_avg[x][y] * frequency_avg[x][y]/frequency_max;
but this would make some parts of the fractal lose detail, which is undesirable[4].
[edit] References
- ^ Mitchell Whitelaw (2004). Metacreation: Art and Artificial Life. MIT Press. pp 155.
- ^ a b "Information about Apophysis software". http://apophysis.wikispaces.com/. Retrieved 2008-03-11.
- ^ Chris Gehman and Steve Reinke (2005). The Sharpest Point: Animation at the End of Cinema. YYZ Books. pp 269.
- ^ a b c The Fractal Flame AlgorithmPDF (22.5 MB)
[edit] See also
- Apophysis, an open source fractal flame editor for Microsoft Windows.
- Electric Sheep, a screen saver which displays fractal flames created with Distributed computing.
- GIMP, a free software, multi OS image manipulation program that can generate fractal flames.
[edit] External links
| Wikimedia Commons has media related to: Fractal flames |
- The Fractal Flame AlgorithmPDF (22.5 MB), a paper with a detailed explanation of how and why the fractal flames work
| This mathematics-related article is a stub. You can help Wikipedia by expanding it. |
| This geometry-related article is a stub. You can help Wikipedia by expanding it. |

