# Fractals/ultrafractal

UltraFractal is a program by Frederik Slijkerman

use wine

# Help

• file types
• Fractal Forum 

# formula

## outside coloring

• Average Colorings

### ExponentialSmoothing

```

ExponentialSmoothing {
; from Standard.ucl
; This coloring method provides smooth iteration
; colors for all fractal types, convergent or
; divergent (or both).  It combines the two methods
; developed by Ron Barnett.  It doesn't map
; precisely to iterations, but it's close.
;
; Written by Damien M. Jones
;
init:
float sum = 0.0
float sum2 = 0.0
complex zold = (0,0)

loop:
IF (@diverge)
sum = sum + exp(-cabs(#z))
ENDIF
IF (@converge)
sum2 = sum2 + exp(-1/cabs(zold-#z))
ENDIF
zold = #z

final:
IF (|#z - zold| < 0.5)	; convergent bailout.
IF (@converge)
#index = sum2
ELSE
#index = 0
ENDIF

ELSE				; divergent bailout.
IF (@diverge)
#index = sum * @divergescale
ELSE
#index = 0
ENDIF
ENDIF

default:
title = "Exponential Smoothing"
helpfile = "Uf*.chm"
helptopic = "Html/coloring/standard/exponentialsmoothing.html"
\$IFDEF VER50
rating = recommended
\$ENDIF

param diverge
caption = "Color Divergent"
default = FALSE
hint = "If checked, points which escape to infinity will be \
colored."
endparam
param converge
caption = "Color Convergent"
default = TRUE
hint = "If checked, points which collapse to one value will be \
colored."
endparam
param divergescale
caption = "Divergent Density"
default = 1.0
\$IFDEF VER40
exponential = true
\$ENDIF
hint = "Sets the divergent coloring density, relative to the \
convergent coloring. If set to 1.0, they will use \
the same color density."
endparam
}
```

### smooth

```Smooth(OUTSIDE) {
; from Standard.ucl
; This coloring method provides smooth iteration
; colors for Mandelbrot and other z^2 formula types
; (Phoenix, Julia).  Results on other types may be
; unpredictable, but might be interesting.
;
; Thanks to F. Slijkerman for some tweaks.
; Thanks to Linas Vepstas for the math.
;
; Written by Damien M. Jones
;
init:
complex il = 1/log(@power)		; Inverse log (power).
float lp = log(log(@bailout))		; log(log bailout).

final:
#index = 0.05 * real(#numiter + il*lp - il*log(log(cabs(#z))))

default:
title = "Smooth (Mandelbrot)"
helpfile = "Uf*.chm"
helptopic = "Html/coloring/standard/smooth.html"
\$IFDEF VER50
rating = recommended
\$ENDIF

param power
caption = "Exponent"
default = (2,0)
hint = "This should be set to match the exponent of the \
formula you are using. For Mandelbrot, this is usually 2."
endparam
param bailout
caption = "Bail-out value"
default = 128.0
min = 1
hint = "This should be set to match the bail-out value in \
the Formula tab. This formula works best with bail-out \
values higher than 100."
endparam
}
```

### binary decomposition

```comment {

This file contains standard coloring algorithms for Ultra Fractal 3.
Many of the coloring algorithms here were written by other formula
authors, as noted in the comments with each formula. All formulas
have been edited and simplified by Frederik Slijkerman.

}

BinaryDecomposition {
; from standard.ucl
; Classic binary decomposition. Can give quite abstract effects.
; Use low bail-out values in the fractal formula (if possible) for
; best effects. This coloring algorithm uses just two colors from
; the gradient: one from the left end and one from the middle.
;
final:
if @type == "Type 1"
if real(#z) * imag(#z) >= 0
#index = 0.5
else
#index = 0
endif
else
if atan2(#z) > 0
#index = 0.5
else
#index = 0
endif
endif
default:
title = "Binary Decomposition"
helpfile = "Uf3.chm"
helptopic = "Html/coloring/standard/binarydecomposition.html"
param type
caption = "Decomposition Type"
enum = "Type 1" "Type 2"
default = 0
hint = "Toggles between two types of binary decomposition. Type 2 \
reproduces the coloring used with many images in the classic \
Beauty of Fractals book."
endparam
}

```

### slope

```// http://www.fractalforums.com/mandel-machine/maybe-perturbation-could-go-with-a-slope/

mbrot2_slope {
fractal:
title="mbrot2_slope" width=1024 height=400 layers=1
credits="Alef;12/4/2014;Frederik;7/23/2010"
layer:
caption="Background" opacity=100
mapping:
center=-0.61777095064903/0.6790465094562 magn=19180.711
angle=156.5545
formula:
maxiter=1000 filename="Standard.ufm" entry="SlopeMandel" p_start=0/0
p_power=2/0 p_bailout=1.0E20 p_offset=0.000000000000001
p_zmode=potential p_xfer=linear p_zscale=1.0 p_zscale2=0.005
p_everyiter=no
inside:
transfer=none
outside:
transfer=linear filename="Standard.ucl" entry="Decomposition"
comments="slightly changed standart. IMHO good sky." smooth=no
rotation=1 index=0 color=6303744 index=64 color=12085789 index=168
color=16777197 index=257 color=33023 index=343 color=512
opacity:
smooth=no index=0 opacity=255
}

mbrot3_slope {
; copyright Kerry Mitchell 15sep98
;
; sample image to illustrate
; embossing effect
fractal:
title="mbrot3_slope" width=1024 height=512 layers=1
credits="Alef;12/4/2014;Kerry Mitchell;9/15/1998"
layer:
caption="Layer 1" opacity=100 method=linear
mapping:
center=-0.81810721128409/0.19884197484006 magn=4118.0018
angle=34.1619
formula:
maxiter=1000 percheck=off filename="Standard.ufm"
entry="SlopeMandel" p_start=0/0 p_power=2/0 p_bailout=1.0E20
p_offset=0.000000000000001 p_zmode="distance estimator"
p_xfer=linear p_zscale=1.0 p_zscale2=0.005 p_everyiter=no
inside:
transfer=none
outside:
transfer=linear filename="Standard.ucl" entry="Decomposition"
comments="slightly changed standart. IMHO good sky." smooth=no
rotation=1 index=0 color=6303744 index=64 color=12085789 index=168
color=16777197 index=257 color=33023 index=343 color=512
opacity:
smooth=no index=0 opacity=255
}
```

### field lines

"There's a later version of my formula for field lines - though somewhat extended to include smooth iteration, distance estimation and distance estimation angles in my class formulas for UF - mmf.ulb called "MMF Field Estimator" It's a UF class formula so not quite so easy to follow but I think it should be clear enough. I boiled down "corrections" to field lines that work in most places but at the moment require manual adjustment to work properly - these are the two parameters that can be modified by the user to fix errors in the field lines, unfortunately you can't always fix them everywhere in view even then but this is about as close as you can get I think. I tried including the MMF Field Lines code here but unfortunately it's too long, it's in mmf.ulb in te Ultra Fractal Formula database at: http://formulas.ultrafractal.com/ " David Makin

```MMF3-FieldLines {
;
; This version of calculating field lines will work reasonably well with both
; Mandelbrot and Julia Sets for divergent fractals with a divergence that is
; close to being a positive integer >=2 but can also produce quite interesting
; results with fractals that do not fit that criteria - just not rendering the
; field lines correctly in other cases :-)
;
; Thanks to Chris Hayton for showing me how to fix the "off-by-one" problems.
;  http://www.fractalforums.com/programming/smooth-external-angle-of-mandelbrot-set/
; David Makin
; Here's my code from mmf3.ucl for Ultra Fractal:
;
global:
float twopi = 2.0*#pi
float dtwopi = 0.5/#pi
float dp = 1.0/@power
float m = @power*dtwopi
float dp2 = 1.0/(2.0+@power) ; Changed from originally trying 1/power
init:
complex zv[#maxiter]
int i = 0
float a = 0.0
float b = 0.0
float c = 0.0
float s = 0.0
if @julia
zv[i] = #z
i = i + 1
endif
loop:
zv[i] = #z
i = i + 1
final:
if (s = atan2(#z))<0
s = s + twopi
endif
while i > @skipiter
i = i - 1
if @version==0
b = (@power*atan2(zv[i]))%twopi
else
b = atan2(zv[i]^@power)
endif
if b < 0.0
b = b + twopi
endif
c = c + b - s
if c >= #pi
s = s + twopi
if @fixit || @accident
c = c - twopi
endif
elseif c < -#pi
s = s - twopi
if @fixit || @accident
c = c + twopi
endif
endif
if @fixit
c = dp2*c
elseif !@accident
c = 0.0
endif
if (a = atan2(zv[i])) < 0.0
a = a + twopi
endif
s = dp*(s + twopi*floor(a*m))
endwhile
s = s*dtwopi
if @fixskip
while s<0.0
s = s + 1.0
endwhile
while s>=1.0
s = s - 1.0
endwhile
endif
#index = s
default:
title = "MMF3 Field Lines (use high bailouts)"
caption = "Information"
;    text = "This colouring is a little touchy around certain values, if you \
;            get obvious lines or dots that shouldn't be there but the 'Degree \
;            of Divergence' is set properly for the main formula and you are \
;            using a high bailout of say 1e20 or higher then try \
;            adjusting the location very slightly. For example if vertical \
;            lines appear on an unrotated fractal then try changing the x \
;            (real) location very slightly, if horizontal lines appear then try \
;            changing the y (imag) location very slightly."
param version
caption = "Version"
enum = "Original" "Alternative"
default = 1
hint = "Allows you to modify one of the calculations in the formula that \
is particularly sensitive to small errors. Ideally both methods \
should produce identical results but they don't, so if you get \
visible errors using one method then try the other (assuming you \
have the divergence set correctly and are using a high bailout)."
endparam
param power
caption = "Degree of divergence"
default = 2.0
hint = "This is an estimate of the divergence of the main formula, e.g. 2 \
for z^2+c, 3 for z^3+c etc."
endparam
param julia
caption = "Julia ?"
default = false
hint = "Enable for correct rendering of Julia Sets."
endparam
param skipiter
caption = "'Start' iteration"
default = 0
min = 0
hint = "You can use this to attempt to get better detail at higher \
iteration depths, note that it only works as intended with 'Color \
Density' as a whole integer >=1."
endparam
param fixskip
caption = "Fix 'Start' iteration"
default = false
hint = "Fixes a problem when the start iteration is non-zero and maybe in \
other cases - specifically if you get solid areas of palette \
colour zero when the Transfer Function is Linear this may fix the \
problem."
endparam
param fixit
caption = "Fix Field Lines"
default = false
hint = "Enable this to make the formula much more accurate at rendering \
the field lines correctly. It's a fudge produced after trial and \
error but is quite effective at correcting some areas."
endparam
param accident
caption = "Happy Accident"
default = false
hint = "You may find the colouring useful when this is enabled. This \
is available as I found the results when initially adding the \
'Fix it' option quite interesting."
visible = !@fixit
endparam
}
```

### multiwave

Gradient file by Pauldebrot 

```MandelMultiwave {
global:
color c2x0 = hsl(0,0.5,0.5 + @lmag/2)
color c2x1 = hsl(0,0.5,0.5)
color c2x2 = hsl(0,0.5,0.5 - @lmag/2)
color c2x3 = hsl(0,0.5,0.5)
color c3x0 = hsl(0,0.5,0.5 + @lmag2/2)
color c3x1 = hsl(0,0.5,0.5)
color c3x2 = hsl(0,0.5,0.5 - @lmag2/2)
color c3x3 = hsl(0,0.5,0.5)
color c4x0 = hsl(0,0.5,0.5 + @lmag3/2)
color c4x1 = hsl(0,0.5,0.5)
color c4x2 = hsl(0,0.5,0.5 - @lmag3/2)
color c4x3 = hsl(0,0.5,0.5)
color c5x0 = hsl(0,0.5,0.5)
color c5x1 = hsl(0,0.5,0.5 - @lmag4/2)
color c5x2 = hsl(0,0.5,0.5)
color c5x3 = hsl(0,0.5,0.5 + @lmag4/2)
init:
complex il = 1/log(@power)		; Inverse log (power).
float lp = log(log(@bailout))		; log(log bailout).
final:
float i = real(#numiter + il*lp - il*log(log(cabs(#z)))) + @displacement
IF (i < 1)
i = 1
ENDIF
i = (i - 1)*@rescale + 1
float ix = (i - 1)/@hfreq2
ix = ix - trunc(ix)
color c1a
color c1b
color c1c
color c1d
color c2a
color c2b
color c2c
color c2d
color c3a
color c3b
color c3c
color c3d
color c4a
color c4b
color c4c
color c4d
IF (ix < 1/5)
ix = ix*5
c1a = @c1e
c1b = @c1a
c1c = @c1b
c1d = @c1c
c2a = @c2e
c2b = @c2a
c2c = @c2b
c2d = @c2c
c3a = @c3e
c3b = @c3a
c3c = @c3b
c3d = @c3c
c4a = @c4e
c4b = @c4a
c4c = @c4b
c4d = @c4c
ELSEIF (ix < 2/5)
ix = (ix - 1/5)*5
c1a = @c1a
c1b = @c1b
c1c = @c1c
c1d = @c1d
c2a = @c2a
c2b = @c2b
c2c = @c2c
c2d = @c2d
c3a = @c3a
c3b = @c3b
c3c = @c3c
c3d = @c3d
c4a = @c4a
c4b = @c4b
c4c = @c4c
c4d = @c4d
ELSEIF (ix < 3/5)
ix = (ix - 2/5)*5
c1a = @c1b
c1b = @c1c
c1c = @c1d
c1d = @c1e
c2a = @c2b
c2b = @c2c
c2c = @c2d
c2d = @c2e
c3a = @c3b
c3b = @c3c
c3c = @c3d
c3d = @c3e
c4a = @c4b
c4b = @c4c
c4c = @c4d
c4d = @c4e
ELSEIF (ix < 4/5)
ix = (ix - 3/5)*5
c1a = @c1c
c1b = @c1d
c1c = @c1e
c1d = @c1a
c2a = @c2c
c2b = @c2d
c2c = @c2e
c2d = @c2a
c3a = @c3c
c3b = @c3d
c3c = @c3e
c3d = @c3a
c4a = @c4c
c4b = @c4d
c4c = @c4e
c4d = @c4a
ELSE
ix = (ix - 4/5)*5
c1a = @c1d
c1b = @c1e
c1c = @c1a
c1d = @c1b
c2a = @c2d
c2b = @c2e
c2c = @c2a
c2d = @c2b
c3a = @c3d
c3b = @c3e
c3c = @c3a
c3d = @c3b
c4a = @c4d
c4b = @c4e
c4c = @c4a
c4d = @c4b
ENDIF
float rp0 = red(c1b)
float gp0 = green(c1b)
float bp0 = blue(c1b)
float rm0 = (red(c1c) - red(c1a))/2
float gm0 = (green(c1c) - green(c1a))/2
float bm0 = (blue(c1c) - blue(c1a))/2
float rp1 = red(c1c)
float gp1 = green(c1c)
float bp1 = blue(c1c)
float rm1 = (red(c1d) - red(c1b))/2
float gm1 = (green(c1d) - green(c1b))/2
float bm1 = (blue(c1d) - blue(c1b))/2
float ixt2 = ix^2
float ixt3 = ix^3
float ixa = 2*ixt3 - 3*ixt2 + 1
float ixb = ixt3 - 2*ixt2 + ix
float ixc = -2*ixt3 + 3*ixt2
float ixd = ixt3 - ixt2
float rrr = ixa*rp0 + ixb*rm0 + ixc*rp1 + ixd*rm1
float ggg = ixa*gp0 + ixb*gm0 + ixc*gp1 + ixd*gm1
float bbb = ixa*bp0 + ixb*bm0 + ixc*bp1 + ixd*bm1
IF (rrr < 0.0)
rrr = 0.0
ELSEIF (rrr > 1.0)
rrr = 1.0
ENDIF
IF (ggg < 0.0)
ggg = 0.0
ELSEIF (ggg > 1.0)
ggg = 1.0
ENDIF
IF (bbb < 0.0)
bbb = 0.0
ELSEIF (bbb > 1.0)
bbb = 1.0
ENDIF
color c1 = rgb(rrr,ggg,bbb)
rp0 = red(c2b)
gp0 = green(c2b)
bp0 = blue(c2b)
rm0 = (red(c2c) - red(c2a))/2
gm0 = (green(c2c) - green(c2a))/2
bm0 = (blue(c2c) - blue(c2a))/2
rp1 = red(c2c)
gp1 = green(c2c)
bp1 = blue(c2c)
rm1 = (red(c2d) - red(c2b))/2
gm1 = (green(c2d) - green(c2b))/2
bm1 = (blue(c2d) - blue(c2b))/2
ixt2 = ix^2
ixt3 = ix^3
ixa = 2*ixt3 - 3*ixt2 + 1
ixb = ixt3 - 2*ixt2 + ix
ixc = -2*ixt3 + 3*ixt2
ixd = ixt3 - ixt2
rrr = ixa*rp0 + ixb*rm0 + ixc*rp1 + ixd*rm1
ggg = ixa*gp0 + ixb*gm0 + ixc*gp1 + ixd*gm1
bbb = ixa*bp0 + ixb*bm0 + ixc*bp1 + ixd*bm1
IF (rrr < 0.0)
rrr = 0.0
ELSEIF (rrr > 1.0)
rrr = 1.0
ENDIF
IF (ggg < 0.0)
ggg = 0.0
ELSEIF (ggg > 1.0)
ggg = 1.0
ENDIF
IF (bbb < 0.0)
bbb = 0.0
ELSEIF (bbb > 1.0)
bbb = 1.0
ENDIF
color c2 = rgb(rrr,ggg,bbb)
rp0 = red(c3b)
gp0 = green(c3b)
bp0 = blue(c3b)
rm0 = (red(c3c) - red(c3a))/2
gm0 = (green(c3c) - green(c3a))/2
bm0 = (blue(c3c) - blue(c3a))/2
rp1 = red(c3c)
gp1 = green(c3c)
bp1 = blue(c3c)
rm1 = (red(c3d) - red(c3b))/2
gm1 = (green(c3d) - green(c3b))/2
bm1 = (blue(c3d) - blue(c3b))/2
ixt2 = ix^2
ixt3 = ix^3
ixa = 2*ixt3 - 3*ixt2 + 1
ixb = ixt3 - 2*ixt2 + ix
ixc = -2*ixt3 + 3*ixt2
ixd = ixt3 - ixt2
rrr = ixa*rp0 + ixb*rm0 + ixc*rp1 + ixd*rm1
ggg = ixa*gp0 + ixb*gm0 + ixc*gp1 + ixd*gm1
bbb = ixa*bp0 + ixb*bm0 + ixc*bp1 + ixd*bm1
IF (rrr < 0.0)
rrr = 0.0
ELSEIF (rrr > 1.0)
rrr = 1.0
ENDIF
IF (ggg < 0.0)
ggg = 0.0
ELSEIF (ggg > 1.0)
ggg = 1.0
ENDIF
IF (bbb < 0.0)
bbb = 0.0
ELSEIF (bbb > 1.0)
bbb = 1.0
ENDIF
color c3 = rgb(rrr,ggg,bbb)
rp0 = red(c4b)
gp0 = green(c4b)
bp0 = blue(c4b)
rm0 = (red(c4c) - red(c4a))/2
gm0 = (green(c4c) - green(c4a))/2
bm0 = (blue(c4c) - blue(c4a))/2
rp1 = red(c4c)
gp1 = green(c4c)
bp1 = blue(c4c)
rm1 = (red(c4d) - red(c4b))/2
gm1 = (green(c4d) - green(c4b))/2
bm1 = (blue(c4d) - blue(c4b))/2
ixt2 = ix^2
ixt3 = ix^3
ixa = 2*ixt3 - 3*ixt2 + 1
ixb = ixt3 - 2*ixt2 + ix
ixc = -2*ixt3 + 3*ixt2
ixd = ixt3 - ixt2
rrr = ixa*rp0 + ixb*rm0 + ixc*rp1 + ixd*rm1
ggg = ixa*gp0 + ixb*gm0 + ixc*gp1 + ixd*gm1
bbb = ixa*bp0 + ixb*bm0 + ixc*bp1 + ixd*bm1
IF (rrr < 0.0)
rrr = 0.0
ELSEIF (rrr > 1.0)
rrr = 1.0
ENDIF
IF (ggg < 0.0)
ggg = 0.0
ELSEIF (ggg > 1.0)
ggg = 1.0
ENDIF
IF (bbb < 0.0)
bbb = 0.0
ELSEIF (bbb > 1.0)
bbb = 1.0
ENDIF
color c4 = rgb(rrr,ggg,bbb)
ix = (i - 1)/@hfreq1
ix = ix - trunc(ix)
color ca
color cb
color cc
color cd
IF (ix < 1/4)
ix = ix*4
ca = c4
cb = c1
cc = c2
cd = c3
ELSEIF (ix < 1/2)
ix = (ix - 1/4)*4
ca = c1
cb = c2
cc = c3
cd = c4
ELSEIF (ix < 3/4)
ix = (ix - 1/2)*4
ca = c2
cb = c3
cc = c4
cd = c1
ELSE
ix = (ix - 3/4)*4
ca = c3
cb = c4
cc = c1
cd = c2
ENDIF
rp0 = red(cb)
gp0 = green(cb)
bp0 = blue(cb)
rm0 = (red(cc) - red(ca))/2
gm0 = (green(cc) - green(ca))/2
bm0 = (blue(cc) - blue(ca))/2
rp1 = red(cc)
gp1 = green(cc)
bp1 = blue(cc)
rm1 = (red(cd) - red(cb))/2
gm1 = (green(cd) - green(cb))/2
bm1 = (blue(cd) - blue(cb))/2
ixt2 = ix^2
ixt3 = ix^3
ixa = 2*ixt3 - 3*ixt2 + 1
ixb = ixt3 - 2*ixt2 + ix
ixc = -2*ixt3 + 3*ixt2
ixd = ixt3 - ixt2
rrr = ixa*rp0 + ixb*rm0 + ixc*rp1 + ixd*rm1
ggg = ixa*gp0 + ixb*gm0 + ixc*gp1 + ixd*gm1
bbb = ixa*bp0 + ixb*bm0 + ixc*bp1 + ixd*bm1
IF (rrr < 0.0)
rrr = 0.0
ELSEIF (rrr > 1.0)
rrr = 1.0
ENDIF
IF (ggg < 0.0)
ggg = 0.0
ELSEIF (ggg > 1.0)
ggg = 1.0
ENDIF
IF (bbb < 0.0)
bbb = 0.0
ELSEIF (bbb > 1.0)
bbb = 1.0
ENDIF
c2 = rgb(rrr,ggg,bbb)
ix = (i - 1)/@sfreq
ix = ix - trunc(ix)
IF (ix < 1/3)
ix = ix*3
ca = @cz
cb = @cx
cc = @cy
cd = @cz
ELSEIF (ix < 2/3)
ix = (ix - 1/3)*3
ca = @cx
cb = @cy
cc = @cz
cd = @cx
ELSE
ix = (ix - 2/3)*3
ca = @cy
cb = @cz
cc = @cx
cd = @cy
ENDIF
rp0 = red(cb)
gp0 = green(cb)
bp0 = blue(cb)
rm0 = (red(cc) - red(ca))/2
gm0 = (green(cc) - green(ca))/2
bm0 = (blue(cc) - blue(ca))/2
rp1 = red(cc)
gp1 = green(cc)
bp1 = blue(cc)
rm1 = (red(cd) - red(cb))/2
gm1 = (green(cd) - green(cb))/2
bm1 = (blue(cd) - blue(cb))/2
ixt2 = ix^2
ixt3 = ix^3
ixa = 2*ixt3 - 3*ixt2 + 1
ixb = ixt3 - 2*ixt2 + ix
ixc = -2*ixt3 + 3*ixt2
ixd = ixt3 - ixt2
rrr = ixa*rp0 + ixb*rm0 + ixc*rp1 + ixd*rm1
ggg = ixa*gp0 + ixb*gm0 + ixc*gp1 + ixd*gm1
bbb = ixa*bp0 + ixb*bm0 + ixc*bp1 + ixd*bm1
IF (rrr < 0.0)
rrr = 0.0
ELSEIF (rrr > 1.0)
rrr = 1.0
ENDIF
IF (ggg < 0.0)
ggg = 0.0
ELSEIF (ggg > 1.0)
ggg = 1.0
ENDIF
IF (bbb < 0.0)
bbb = 0.0
ELSEIF (bbb > 1.0)
bbb = 1.0
ENDIF
c3 = rgb(rrr,ggg,bbb)
float hh = hue(c2)
float ss = sat(c2)
float ll = lum(c2)
IF (ll != 1.0 && lum(c3) != 1.0)
ll = 1 - 1/((1/(1 - ll) - 1)*(1/(1 - lum(c3)) - 1) + 1)
ENDIF
IF (@smode == 0)
ss = ss*(1 - sat(c3)*(((1 - cos((hh - hue(c3))*#pi/3))/2)^@spow))
ELSE
hh = (hh + hue(c3))%6
IF (ss != 1.0 && sat(c3) != 1.0)
ss = 1 - 1/((1/(1 - ss) - 1)*(1/(1 - sat(c3)) - 1) + 1)
ENDIF
ENDIF
c1 = hsl(hh,ss,ll)
ix = (i - 1)/@lfreq
ix = ix - trunc(ix)
IF (ix < 1/4)
ix = ix*4
ca = c2x3
cb = c2x0
cc = c2x1
cd = c2x2
ELSEIF (ix < 1/2)
ix = (ix - 1/4)*4
ca = c2x0
cb = c2x1
cc = c2x2
cd = c2x3
ELSEIF (ix < 3/4)
ix = (ix - 1/2)*4
ca = c2x1
cb = c2x2
cc = c2x3
cd = c2x0
ELSE
ix = (ix - 3/4)*4
ca = c2x2
cb = c2x3
cc = c2x0
cd = c2x1
ENDIF
rp0 = red(cb)
gp0 = green(cb)
bp0 = blue(cb)
rm0 = (red(cc) - red(ca))/2
gm0 = (green(cc) - green(ca))/2
bm0 = (blue(cc) - blue(ca))/2
rp1 = red(cc)
gp1 = green(cc)
bp1 = blue(cc)
rm1 = (red(cd) - red(cb))/2
gm1 = (green(cd) - green(cb))/2
bm1 = (blue(cd) - blue(cb))/2
ixt2 = ix^2
ixt3 = ix^3
ixa = 2*ixt3 - 3*ixt2 + 1
ixb = ixt3 - 2*ixt2 + ix
ixc = -2*ixt3 + 3*ixt2
ixd = ixt3 - ixt2
rrr = ixa*rp0 + ixb*rm0 + ixc*rp1 + ixd*rm1
ggg = ixa*gp0 + ixb*gm0 + ixc*gp1 + ixd*gm1
bbb = ixa*bp0 + ixb*bm0 + ixc*bp1 + ixd*bm1
IF (rrr < 0.0)
rrr = 0.0
ELSEIF (rrr > 1.0)
rrr = 1.0
ENDIF
IF (ggg < 0.0)
ggg = 0.0
ELSEIF (ggg > 1.0)
ggg = 1.0
ENDIF
IF (bbb < 0.0)
bbb = 0.0
ELSEIF (bbb > 1.0)
bbb = 1.0
ENDIF
c2 = rgb(rrr,ggg,bbb)
ix = (i - 1)/@lfreq2
ix = ix - trunc(ix)
IF (ix < 1/4)
ix = ix*4
ca = c3x3
cb = c3x0
cc = c3x1
cd = c3x2
ELSEIF (ix < 1/2)
ix = (ix - 1/4)*4
ca = c3x0
cb = c3x1
cc = c3x2
cd = c3x3
ELSEIF (ix < 3/4)
ix = (ix - 1/2)*4
ca = c3x1
cb = c3x2
cc = c3x3
cd = c3x0
ELSE
ix = (ix - 3/4)*4
ca = c3x2
cb = c3x3
cc = c3x0
cd = c3x1
ENDIF
rp0 = red(cb)
gp0 = green(cb)
bp0 = blue(cb)
rm0 = (red(cc) - red(ca))/2
gm0 = (green(cc) - green(ca))/2
bm0 = (blue(cc) - blue(ca))/2
rp1 = red(cc)
gp1 = green(cc)
bp1 = blue(cc)
rm1 = (red(cd) - red(cb))/2
gm1 = (green(cd) - green(cb))/2
bm1 = (blue(cd) - blue(cb))/2
ixt2 = ix^2
ixt3 = ix^3
ixa = 2*ixt3 - 3*ixt2 + 1
ixb = ixt3 - 2*ixt2 + ix
ixc = -2*ixt3 + 3*ixt2
ixd = ixt3 - ixt2
rrr = ixa*rp0 + ixb*rm0 + ixc*rp1 + ixd*rm1
ggg = ixa*gp0 + ixb*gm0 + ixc*gp1 + ixd*gm1
bbb = ixa*bp0 + ixb*bm0 + ixc*bp1 + ixd*bm1
IF (rrr < 0.0)
rrr = 0.0
ELSEIF (rrr > 1.0)
rrr = 1.0
ENDIF
IF (ggg < 0.0)
ggg = 0.0
ELSEIF (ggg > 1.0)
ggg = 1.0
ENDIF
IF (bbb < 0.0)
bbb = 0.0
ELSEIF (bbb > 1.0)
bbb = 1.0
ENDIF
c3 = rgb(rrr,ggg,bbb)
ix = (i - 1)/@lfreq3
ix = ix - trunc(ix)
IF (ix < 1/4)
ix = ix*4
ca = c4x3
cb = c4x0
cc = c4x1
cd = c4x2
ELSEIF (ix < 1/2)
ix = (ix - 1/4)*4
ca = c4x0
cb = c4x1
cc = c4x2
cd = c4x3
ELSEIF (ix < 3/4)
ix = (ix - 1/2)*4
ca = c4x1
cb = c4x2
cc = c4x3
cd = c4x0
ELSE
ix = (ix - 3/4)*4
ca = c4x2
cb = c4x3
cc = c4x0
cd = c4x1
ENDIF
rp0 = red(cb)
gp0 = green(cb)
bp0 = blue(cb)
rm0 = (red(cc) - red(ca))/2
gm0 = (green(cc) - green(ca))/2
bm0 = (blue(cc) - blue(ca))/2
rp1 = red(cc)
gp1 = green(cc)
bp1 = blue(cc)
rm1 = (red(cd) - red(cb))/2
gm1 = (green(cd) - green(cb))/2
bm1 = (blue(cd) - blue(cb))/2
ixt2 = ix^2
ixt3 = ix^3
ixa = 2*ixt3 - 3*ixt2 + 1
ixb = ixt3 - 2*ixt2 + ix
ixc = -2*ixt3 + 3*ixt2
ixd = ixt3 - ixt2
rrr = ixa*rp0 + ixb*rm0 + ixc*rp1 + ixd*rm1
ggg = ixa*gp0 + ixb*gm0 + ixc*gp1 + ixd*gm1
bbb = ixa*bp0 + ixb*bm0 + ixc*bp1 + ixd*bm1
IF (rrr < 0.0)
rrr = 0.0
ELSEIF (rrr > 1.0)
rrr = 1.0
ENDIF
IF (ggg < 0.0)
ggg = 0.0
ELSEIF (ggg > 1.0)
ggg = 1.0
ENDIF
IF (bbb < 0.0)
bbb = 0.0
ELSEIF (bbb > 1.0)
bbb = 1.0
ENDIF
c4 = rgb(rrr,ggg,bbb)
ix = (i - 1)/@lfreq4
ix = ix - trunc(ix)
IF (ix < 1/4)
ix = ix*4
ca = c5x3
cb = c5x0
cc = c5x1
cd = c5x2
ELSEIF (ix < 1/2)
ix = (ix - 1/4)*4
ca = c5x0
cb = c5x1
cc = c5x2
cd = c5x3
ELSEIF (ix < 3/4)
ix = (ix - 1/2)*4
ca = c5x1
cb = c5x2
cc = c5x3
cd = c5x0
ELSE
ix = (ix - 3/4)*4
ca = c5x2
cb = c5x3
cc = c5x0
cd = c5x1
ENDIF
rp0 = red(cb)
gp0 = green(cb)
bp0 = blue(cb)
rm0 = (red(cc) - red(ca))/2
gm0 = (green(cc) - green(ca))/2
bm0 = (blue(cc) - blue(ca))/2
rp1 = red(cc)
gp1 = green(cc)
bp1 = blue(cc)
rm1 = (red(cd) - red(cb))/2
gm1 = (green(cd) - green(cb))/2
bm1 = (blue(cd) - blue(cb))/2
ixt2 = ix^2
ixt3 = ix^3
ixa = 2*ixt3 - 3*ixt2 + 1
ixb = ixt3 - 2*ixt2 + ix
ixc = -2*ixt3 + 3*ixt2
ixd = ixt3 - ixt2
rrr = ixa*rp0 + ixb*rm0 + ixc*rp1 + ixd*rm1
ggg = ixa*gp0 + ixb*gm0 + ixc*gp1 + ixd*gm1
bbb = ixa*bp0 + ixb*bm0 + ixc*bp1 + ixd*bm1
IF (rrr < 0.0)
rrr = 0.0
ELSEIF (rrr > 1.0)
rrr = 1.0
ENDIF
IF (ggg < 0.0)
ggg = 0.0
ELSEIF (ggg > 1.0)
ggg = 1.0
ENDIF
IF (bbb < 0.0)
bbb = 0.0
ELSEIF (bbb > 1.0)
bbb = 1.0
ENDIF
color c5 = rgb(rrr,ggg,bbb)
float mn = @fitminit
float mx = @fitmaxit
ix = i
IF (@transfer == 1)
ix = ix^(1/@transpower)
mn = mn^(1/@transpower)
mx = mx^(1/@transpower)
ELSEIF (@transfer == 2)
ix = log(ix)
mn = log(mn)
mx = log(mx)
ENDIF
IF (@fit)
IF (ix < mn)
ix = 0
ELSE
ix = (ix - mn)/(mx - mn)
ENDIF
ix = ix * @fittimes
ELSE
ix = 0.05*ix
ENDIF
color c6 = gradient(ix)
IF (@mmode == 1)
hh = (hue(c1)+hue(c6))%6
float sc1 = sat(c1)
float sc6 = sat(c6)
IF (sc1 > 0.99)
sc1 = 0.99
ENDIF
IF (sc6 > 0.99)
sc6 = 0.99
ENDIF
sc1 = 1/(1 - sc1) - 1
sc6 = 1/(1 - sc6) - 1
ss = sc1*sc6
ss = 1 - 1/(ss + 1)
float ll1 = lum(c1)
float ll2 = lum(c2)
float ll3 = lum(c3)
float ll4 = lum(c4)
float ll5 = lum(c5)
float ll6 = lum(c6)
IF (ll1 == 1.0 || ll2 == 1.0 || ll3 == 1.0 || ll4 == 1.0 || ll5 == 1.0 || ll6 == 1.0)
ll = 1.0
ELSE
ll1 = 1/(1 - ll1) - 1
ll2 = 1/(1 - ll2) - 1
ll3 = 1/(1 - ll3) - 1
ll4 = 1/(1 - ll4) - 1
ll5 = 1/(1 - ll5) - 1
ll6 = 1/(1 - ll6) - 1
ll = ll1*ll2*ll3*ll4*ll5*ll6
ll = 1 - 1/(ll + 1)
ENDIF
IF (ss < 0)
ss = 0
ELSEIF (ss > 1)
ss = 1
ENDIF
IF (ll < 0)
ll = 0
ELSEIF (ll > 1)
ll = 1
ENDIF
#color = hsl(hh,ss,ll)
ELSE
hh = hue(c1)
ss = sat(c1)
float ll1 = lum(c1)
float ll2 = lum(c2)
float ll3 = lum(c3)
float ll4 = lum(c4)
float ll5 = lum(c5)
IF (ll1 == 1.0 || ll2 == 1.0 || ll3 == 1.0 || ll4 == 1.0 || ll5 == 1.0)
ll = 1.0
ELSE
ll1 = 1/(1 - ll1) - 1
ll2 = 1/(1 - ll2) - 1
ll3 = 1/(1 - ll3) - 1
ll4 = 1/(1 - ll4) - 1
ll5 = 1/(1 - ll5) - 1
ll = ll1*ll2*ll3*ll4*ll5
ll = 1 - 1/(ll + 1)
ENDIF
IF (ll < 0)
ll = 0
ELSEIF (ll > 1)
ll = 1
ENDIF
IF (@mmode == 0)
c1 = hsl(hh,ss,ll)
float rr6 = red(c6)
float gg6 = green(c6)
float bb6 = blue(c6)
IF (rr6 > 0.99)
rr6 = 0.99
ENDIF
IF (gg6 > 0.99)
gg6 = 0.99
ENDIF
IF (bb6 > 0.99)
bb6 = 0.99
ENDIF
float rr1 = red(c1)
float gg1 = green(c1)
float bb1 = blue(c1)
IF (rr1 > 0.99)
rr1 = 0.99
ENDIF
IF (gg1 > 0.99)
gg1 = 0.99
ENDIF
IF (bb1 > 0.99)
bb1 = 0.99
ENDIF
rr6 = 1/(1 - rr6) - 1
gg6 = 1/(1 - gg6) - 1
bb6 = 1/(1 - bb6) - 1
rr1 = 1/(1 - rr1) - 1
gg1 = 1/(1 - gg1) - 1
bb1 = 1/(1 - bb1) - 1
float rrr = 1 - 1/(rr6*rr1 + 1)
float ggg = 1 - 1/(gg6*gg1 + 1)
float bbb = 1 - 1/(bb6*bb1 + 1)
#color = rgb(rrr,ggg,bbb)
ELSE
float aa = alpha(c5)
float omaa = 1 - aa
IF (@mmode == 2)
c1 = hsl(hh,ss,ll)
float rrr = red(c6)*aa + red(c1)*omaa
float ggg = green(c6)*aa + green(c1)*omaa
float bbb = blue(c6)*aa + blue(c1)*omaa
#color = rgb(rrr,ggg,bbb)
ELSE
hh = (hue(c6)+hh)%6
ss = sat(c6)*aa + ss*omaa
ll = lum(c6)*aa + ll*omaa
#color = hsl(hh,ss,ll)
ENDIF
ENDIF
ENDIF
default:
title = "Mandelbrot Multiwave Coloring"
param power
caption = "Exponent"
default = (2,0)
hint = "This should be set to match the exponent of the \
formula you are using. For Mandelbrot, this is 2. \
Only needed when coloring divergent points."
endparam
color param c1a
caption = "Hue 1A"
default = rgb(130/255,91/255,40/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c2a
caption = "Hue 2A"
default = rgb(186/255,153/255,102/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c3a
caption = "Hue 3A"
default = rgb(248/255,114/255,12/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c4a
caption = "Hue 4A"
default = rgb(74/255,0,0)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
param hfreq1
caption = "Short hue shift period (iters)"
default = 530.0
hint = "Changes the period of the short hue modification cycle. Early in the long cycle it will cycle among the four colors above."
endparam
color param c1b
caption = "Hue 1B"
default = rgb(77/255,49/255,19/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c2b
caption = "Hue 2B"
default = rgb(195/255,179/255,131/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c3b
caption = "Hue 3B"
default = rgb(231/255,227/255,23/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c4b
caption = "Hue 4B"
default = rgb(240/255,164/255,0)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c1c
caption = "Hue 1C"
default = rgb(0,72/255,16/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c2c
caption = "Hue 2C"
default = rgb(133/255,146/255,128/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c3c
caption = "Hue 3C"
default = rgb(179/255,220/255,72/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c4c
caption = "Hue 4C"
default = rgb(243/255,224/255,83/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c1d
caption = "Hue 1D"
default = rgb(24/255,23/255,103/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c2d
caption = "Hue 2D"
default = rgb(144/255,143/255,163/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c3d
caption = "Hue 3D"
default = rgb(64/255,153/255,192/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c4d
caption = "Hue 4D"
default = rgb(31/255,173/255,131/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c1e
caption = "Hue 1E"
default = rgb(120/255,22/255,22/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c2e
caption = "Hue 2E"
default = rgb(177/255,129/255,130/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c3e
caption = "Hue 3E"
default = rgb(189/255,65/255,68/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param c4e
caption = "Hue 4E"
default = rgb(33/255,31/255,79/255)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
param hfreq2
caption = "Long hue shift period (iters)"
default = 5147.0
hint = "Changes the period of the long hue modification cycle."
endparam
color param cx
caption = "Superslow bias color 1"
default = rgb(0.5,0.5,0.5)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param cy
caption = "Superslow bias color 2"
default = hsl(0,0.5,0.7)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
color param cz
caption = "Superslow bias color 3"
default = hsl(5,1.0,0.3)
hint = "Altering these hues will alter the way the gradient is modified."
endparam
param sfreq
caption = "Superslow bias period (iters)"
default = 82117.0
hint = "Changes the period of the superslow bias cycle."
endparam
param smode
caption = "Superslow bias mode"
enum = "saturation bias" "hsl bias"
default = 1
hint = "Luminances adjust luminance of colors above; in saturation bias mode hue/saturation adjusts saturation. Hues matching this hue are unchanged, hues opposite have their saturation reduced the higher this color's saturation. The effect is to suppress opposite hues; set this to saturated red to suppress cyan for example. Neutral gray has no effect. In hsl bias mode hsl addition is used instead."
endparam
param spow
caption = "Superslow bias sensitivity"
default = 4.0
min = 0.01
hint = "Higher values narrow the range of hues desaturated; lower ones widen the range. 2 and 0.5 have opposite effects."
endparam
param lfreq
caption = "First luminance shift period (iters)"
default = 17.0
hint = "Changes the period of the first luminance modification cycle. The four colors of the short cycle will change gradually to the second set of four, then the third, then the fourth, before returning."
endparam
param lmag
caption = "First luminance shift amplitude"
default = 0.2
min = 0.0
max = 1.0
hint = "Changes the amplitude of the first luminance modification cycle."
endparam
param lfreq2
caption = "Second luminance shift period (iters)"
default = 94.0
hint = "Changes the period of the second luminance modification cycle."
endparam
param lmag2
caption = "Second luminance shift amplitude"
default = 0.4
min = 0.0
max = 1.0
hint = "Changes the amplitude of the second luminance modification cycle."
endparam
param lfreq3
caption = "Third luminance shift period (iters)"
default = 2544.0
hint = "Changes the period of the third luminance modification cycle."
endparam
param lmag3
caption = "Third luminance shift amplitude"
default = 0.6
min = 0.0
max = 1.0
hint = "Changes the amplitude of the third luminance modification cycle."
endparam
param lfreq4
caption = "Fourth luminance shift period (iters)"
default = 18544.0
hint = "Changes the period of the fourth luminance modification cycle."
endparam
param lmag4
caption = "Fourth luminance shift amplitude"
default = 0.6
min = 0.0
max = 1.0
hint = "Changes the amplitude of the fourth luminance modification cycle."
endparam
param mmode
caption = "Primary gradient merge mode"
enum = "rgb bias" "hsl bias" "rgb blend" "hsl blend"
default = 1
hint = "Affects how the gradient is applied to the color ripples; the blend options use the gradient's alpha"
endparam
param fit
caption = "Fit Gradient to Range"
default = true
hint = "Check this to spread the gradient out over the range of iteration values."
endparam
param fittimes
caption = "Number of repetitions"
default = 1.0
min = 1.0
hint = "Repeats gradient the specified number of times over the range of iteration values."
endparam
param fitminit
caption = "Start iteration"
default = 1.0
min = 1.0
hint = "Gradient begins at this iteration number. It is best if it's approximately the lowest \
actual number of iterations in the image. You can find the exact number by looking at \
Statistics after generating the image once."
endparam
param fitmaxit
caption = "End iteration"
default = 1000.0
min = 1.0
hint = "Gradient fitting is based on this range of iterations. Can be profitably made lower than \
maxiter -- try reducing it by factors of 10 until the gradient doesn't fit well, then raise \
it by a factor of 10 once."
endparam
param transfer
caption = "Super transfer function"
enum = "Linear" "Power" "Log"
default = 2
hint = "Linear distributes gradient evenly over iterations. \
Power weights gradient towards lower iterations for powers > 1. \
Log weights gradient towards lower iterations."
endparam
param transpower
caption = "Transfer power"
default = 3.0
hint = "Larger values weight gradient more towards low iterations. \
3.0 with a regular transfer function of Linear and a super transfer \
function of Linear with a regular transfer function of CubeRoot \
produce the same results."
visible = (@transfer == 1)
endparam
param bailout
caption = "Bail-out value"
default = 100000.0
hint = "Larger gives smoother coloring, up to a point."
min = 1
endparam
param displacement
caption = "Displacement"
default = 0.0
hint = "Skips the first N iterations of the color gradient, effectively shifting the whole color scheme to lower iterations as a block. Use this for testing."
min = 0.0
endparam
param rescale
caption = "Rescaling"
default = 1.0
hint = "Compresses the entire color gradient by this factor, after application of displacement. Use this for testing."
min = 1.0
endparam
}
```

# files

• ufr : Fractal Files *.ufr
• upr : Displays parameter files (*.upr)
• par : Older Fractint parameter files (*.par)
• ugr : Displays gradient files (*.ugr)
• ual : Older gradient files (*.ual)
• map : Fractint palette files (*.map)
• uxf : Displays transformation files (*.uxf)
• ufm : Displays fractal formula files (*.ufm). Fractal formula files contain multiple fractal formulas. Older Fractint formula files (*.frm) are also shown. See Fractal formulas.
• ucl : Displays coloring algorithm files (*.ucl). See also writing coloring algorithm
• ulb : Displays plug-in library files (*.ulb)