<s>
Fractal	B-Algorithm
flames	I-Algorithm
are	O
a	O
member	O
of	O
the	O
iterated	B-Algorithm
function	I-Algorithm
system	I-Algorithm
class	O
of	O
fractals	B-Application
created	O
by	O
Scott	O
Draves	O
in	O
1992	O
.	O
</s>
<s>
Draves	O
 '	O
open-source	O
code	O
was	O
later	O
ported	O
into	O
Adobe	B-Operating_System
After	I-Operating_System
Effects	I-Operating_System
graphics	O
software	O
and	O
translated	O
into	O
the	O
Apophysis	B-Algorithm
fractal	B-Algorithm
flame	I-Algorithm
editor	O
.	O
</s>
<s>
Fractal	B-Algorithm
flames	I-Algorithm
differ	O
from	O
ordinary	O
iterated	B-Algorithm
function	I-Algorithm
systems	I-Algorithm
in	O
three	O
ways	O
:	O
</s>
<s>
Nonlinear	O
functions	O
are	O
iterated	B-Algorithm
in	O
addition	O
to	O
affine	B-Algorithm
transforms	I-Algorithm
.	O
</s>
<s>
The	O
tone	B-Language
mapping	I-Language
and	O
coloring	O
are	O
designed	O
to	O
display	O
as	O
much	O
of	O
the	O
detail	O
of	O
the	O
fractal	B-Application
as	O
possible	O
,	O
which	O
generally	O
results	O
in	O
a	O
more	O
aesthetically	O
pleasing	O
image	O
.	O
</s>
<s>
The	O
algorithm	O
consists	O
of	O
two	O
steps	O
:	O
creating	O
a	O
histogram	B-Algorithm
and	O
then	O
rendering	O
the	O
histogram	B-Algorithm
.	O
</s>
<s>
First	O
,	O
one	O
iterates	B-Algorithm
a	O
set	O
of	O
functions	O
,	O
starting	O
from	O
a	O
randomly	O
chosen	O
point	O
P	O
=	O
(	O
P.x	O
,	O
P.y	O
,	O
P.c	O
)	O
,	O
where	O
the	O
third	O
coordinate	O
indicates	O
the	O
current	O
color	O
of	O
the	O
point	O
.	O
</s>
<s>
In	O
each	O
iteration	B-Algorithm
,	O
choose	O
one	O
of	O
the	O
functions	O
above	O
where	O
the	O
probability	O
that	O
Fj	O
is	O
chosen	O
is	O
pj	O
.	O
</s>
<s>
Then	O
one	O
computes	O
the	O
next	O
iteration	B-Algorithm
of	O
P	O
by	O
applying	O
Fj	O
on	O
(	O
P.x	O
,	O
P.y	O
)	O
.	O
</s>
<s>
that	O
all	O
:s	O
are	O
non-negative	O
and	O
sum	O
to	O
one	O
,	O
but	O
implementations	O
such	O
as	O
Apophysis	B-Algorithm
do	O
not	O
impose	O
that	O
restriction	O
.	O
</s>
<s>
After	O
each	O
iteration	B-Algorithm
,	O
one	O
updates	O
the	O
histogram	B-Algorithm
at	O
the	O
point	O
corresponding	O
to	O
(	O
P.x	O
,	O
P.y	O
)	O
.	O
</s>
<s>
To	O
increase	O
the	O
quality	O
of	O
the	O
image	O
,	O
one	O
can	O
use	O
supersampling	B-Algorithm
to	O
decrease	O
the	O
noise	O
.	O
</s>
<s>
This	O
involves	O
creating	O
a	O
histogram	B-Algorithm
larger	O
than	O
the	O
image	O
so	O
each	O
pixel	O
has	O
multiple	O
data	O
points	O
to	O
pull	O
from	O
.	O
</s>
<s>
For	O
example	O
,	O
create	O
a	O
histogram	B-Algorithm
with	O
300300	O
cells	O
in	O
order	O
to	O
draw	O
a	O
100100	O
px	O
image	O
;	O
each	O
pixel	O
would	O
use	O
a	O
33	O
group	O
of	O
histogram	B-Algorithm
buckets	O
to	O
calculate	O
its	O
value	O
.	O
</s>
<s>
This	O
is	O
implemented	O
in	O
for	O
example	O
the	O
Apophysis	B-Algorithm
software	O
.	O
</s>
<s>
but	O
this	O
would	O
make	O
some	O
parts	O
of	O
the	O
fractal	B-Application
lose	O
detail	O
,	O
which	O
is	O
undesirable	O
.	O
</s>
<s>
The	O
flame	O
algorithm	O
is	O
like	O
a	O
Monte	B-Algorithm
Carlo	I-Algorithm
simulation	I-Algorithm
,	O
with	O
the	O
flame	O
quality	O
directly	O
proportional	O
to	O
the	O
number	O
of	O
iterations	B-Algorithm
of	O
the	O
simulation	O
.	O
</s>
<s>
This	O
problem	O
can	O
be	O
solved	O
with	O
adaptive	O
density	B-General_Concept
estimation	I-General_Concept
to	O
increase	O
image	O
quality	O
while	O
keeping	O
render	O
times	O
to	O
a	O
minimum	O
.	O
</s>
<s>
Not	O
all	O
Flame	O
implementations	O
use	O
density	B-General_Concept
estimation	I-General_Concept
.	O
</s>
