fractal flame
   HOME

TheInfoList



OR:

Fractal flames are a member of the
iterated function system In mathematics, iterated function systems (IFSs) are a method of constructing fractals; the resulting fractals are often self-similar. IFS fractals are more related to set theory than fractal geometry. They were introduced in 1981. IFS fractals ...
class of
fractal In mathematics, a fractal is a Shape, geometric shape containing detailed structure at arbitrarily small scales, usually having a fractal dimension strictly exceeding the topological dimension. Many fractals appear similar at various scale ...
s created by
Scott Draves Scott Draves is an American digital artist. He is the inventor of fractal flames and the leader of the distributed computing project Electric Sheep. He also invented patch-based texture synthesis and published the first implementation of this ...
in 1992. Draves' open-source code was later ported into
Adobe After Effects Adobe After Effects is a digital visual effects, motion graphics, and compositing application developed by Adobe Inc.; it is used for animation and in the post-production process of film making, video games and television production. Amo ...
graphics software and translated into the Apophysis fractal flame editor. Fractal flames differ from ordinary iterated function systems in three ways: *
Nonlinear In mathematics and science, a nonlinear system (or a non-linear system) is a system in which the change of the output is not proportional to the change of the input. Nonlinear problems are of interest to engineers, biologists, physicists, mathe ...
functions are iterated in addition to affine transforms. * Log-density display instead of linear or binary (a form of
tone mapping Tone mapping is a technique used in image processing and computer graphics to map one set of colors to another to approximate the appearance of high-dynamic-range (HDR) images in a medium that has a more limited dynamic range. Print-outs, C ...
) * Color 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.


Algorithm

The algorithm consists of two steps: creating a
histogram A histogram is a visual representation of the frequency distribution, distribution of quantitative data. To construct a histogram, the first step is to Data binning, "bin" (or "bucket") the range of values— divide the entire range of values in ...
and then rendering the histogram.


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 indicates the current color of the point. :Set of flame functions: \begin F_1(x,y), \quad p_1 \\ F_2(x,y), \quad p_2 \\ \dots \\ F_n(x,y), \quad p_n \end 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 applying ''Fj'' on ''(P.x,P.y)''. Each individual function has the following form: :F_j(x,y) = \sum_ w_k \cdot V_k(a_j x + b_j y +c_j,d_j x + e_j y +f_j) where the parameter ''wk'' is called the weight of the ''variation'' ''Vk''. Draves suggests   that all w_k:s are non-negative and sum to one, but implementations such as Apophysis do not impose that restriction. The functions ''Vk'' are a set of predefined functions. A few examples are * V0(''x'',''y'') = (''x'',''y'') (Linear) * V1(''x'',''y'') = (sin ''x'',sin ''y'') (Sinusoidal) * V2(''x'',''y'') = (''x'',''y'')/(''x''2+''y''2) (Spherical) The color ''P.c'' of the point is blended with the color associated with the latest applied function ''Fj'': : P.c := (P.c + (Fj)color) / 2 After each iteration, one updates the histogram at the point corresponding to ''(P.x,P.y)''. This is done as follows: histogram y] REQUENCY:= histogram y] REQUENCY1 histogram y] OLOR:= (histogram y] OLOR+ P.c)/2 The colors in the image will therefore reflect what functions were used to get to that part of the image.


Rendering an image

To increase the quality of the image, one can use
supersampling Supersampling or supersampling anti-aliasing (SSAA) is a spatial anti-aliasing method, i.e. a method used to remove aliasing (jagged and pixelated edges, colloquially known as "jaggies") from images rendered in computer games or other computer p ...
to decrease the noise. This involves creating a histogram larger than the image so each pixel has multiple data points to pull from. For example, create a histogram with 300×300 cells in order to draw a 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 y] := average_of_histogram_cells_frequency(x,y); color_avg y] := average_of_histogram_cells_color(x,y); alpha y] := log(frequency_avg y]) / log(frequency_max); //frequency_max is the maximal number of iterations that hit a cell in the histogram. final_pixel_color y] := color_avg y] * alpha y]^(1/gamma); //gamma is a value greater than 1. The algorithm above uses
gamma correction Gamma correction or gamma is a Nonlinearity, nonlinear operation used to encode and decode Relative luminance, luminance or CIE 1931 color space#Tristimulus values, tristimulus values in video or still image systems. Gamma correction is, in the s ...
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 y] := color_avg y] * frequency_avg y]/frequency_max; but this would make some parts of the fractal lose detail, which is undesirable.


Density estimation

The flame algorithm is like a
Monte Carlo simulation Monte Carlo methods, or Monte Carlo experiments, are a broad class of computational algorithms that rely on repeated random sampling to obtain numerical results. The underlying concept is to use randomness to solve problems that might be det ...
, with the flame quality directly proportional to the number of iterations of the simulation. The noise that results from this stochastic sampling can be reduced by blurring the image, to get a smoother result in less time. One does not however want to lose resolution in the parts of the image that receive many samples and so have little noise. This problem can be solved with adaptive
density estimation In statistics, probability density estimation or simply density estimation is the construction of an estimate, based on observed data, of an unobservable underlying probability density function. The unobservable density function is thought o ...
to increase image quality while keeping render times to a minimum. FLAM3 uses a simplification of the methods presented in *Adaptive Filtering for Progressive Monte Carlo Image Rendering*, a paper presented at WSCG 2000 by Frank Suykens and Yves D. Willems. The idea is to vary the width of the filter
inversely proportional In mathematics, two sequences of numbers, often experimental data, are proportional or directly proportional if their corresponding elements have a constant ratio. The ratio is called ''coefficient of proportionality'' (or ''proportionality ...
to the number of samples available. As a result, areas with few samples and high noise become blurred and smoothed, but areas with many samples and low noise are left unaffected.See https://github.com/scottdraves/flam3/wiki/Density-Estimation. Not all Flame implementations use density estimation.


See also

* Apophysis, an open source fractal flame editor for Microsoft Windows and Macintosh. *
Electric Sheep Electric Sheep is a volunteer computing project for animating and evolving fractal flames, which are in turn distributed to the networked computers, which display them as a screensaver. Process The process is transparent to the casual user, ...
, a screen saver created by the inventor of fractal flames which renders and displays them through
distributed computing Distributed computing is a field of computer science that studies distributed systems, defined as computer systems whose inter-communicating components are located on different networked computers. The components of a distributed system commu ...
. *
GIMP Gimp or GIMP may refer to: Clothing * Bondage suit, also called a gimp suit, a type of suit used in BDSM * Bondage mask, also called a gimp mask, often worn in conjunction with a gimp suit Embroidery and crafts * Gimp (thread), an ornamental tr ...
, a
free software Free software, libre software, libreware sometimes known as freedom-respecting software is computer software distributed open-source license, under terms that allow users to run the software for any purpose as well as to study, change, distribut ...
, multi OS
image manipulation Image editing encompasses the processes of altering images, whether they are Digital photography, digital photographs, traditional Photographic processing, photo-chemical photographs, or illustrations. Traditional analog image editing is known ...
program that can generate fractal flames.


References

{{DEFAULTSORT:Fractal Flame Iterated function system fractals Psychedelic art