Since my last post in February 2024,
https://www.ultrafractal.com/forum/index.php?u=/topic/919/gradient-coloring-plug-ins
I’ve been experimenting, seeing what seems worthwhile and what seems unnecessary. The plug-in successor to “Color by Distance” is “Coloring” in jlb.ulb.
The Coloring function on the Coloring tab is called by Ultra Fractal after each iteration of the function on the Formula tab. The Iteration part of the Coloring function can do whatever it likes with the current Z value (a complex number), often accumulating information to be used later. I call this the “Accumulation phase.” After the Formula iterations have finished, or bailed out, the Coloring function is called again to calculate an ordinary number that is an index into the gradient. I call this the “Final phase.”
In coloring files of type ucl, the “loop” section corresponds to the “Accumulation phase,” and the “final” section corresponds to the “Final phase.”
Typically actions of the Iteration (or loop) part of the Coloring function are to transform the Z value, making a new complex number Z1; saving one or more Z or Z1 values for later use; calculating a new Z2 from Z and Z1; calculating an ordinary number, d, from Z or Z1 or Z2; and saving one or more values of d for later use. Other actions include deciding whether to save anything about the iteration, based on such criteria as whether Z is in a certain range (is “orbit-trapped”), whether d is in a certain range, or whether this iteration is in a certain range.
I call this ordinary number, d, a Distance, as in some Coloring functions it is the same as the distance between two points in the complex plane.
The standard class that takes a Z value as input and generates a Z1 value is the UserTransform. (It’s defined in common.ulb but there’s no need for non-programmers to look at it.) It is the same class that is used as a plug-in on the Mapping tab, although not all UserTransforms that are useful on the Mapping tab are also useful on the Coloring tab, and vice versa.
UserTransforms can be found in Standard.ulb, dmj5.ulb, jlb.ulb, mmf.ulb, mt.ulb, om.ulb, reb.ulb, and thm.ulb.
Here’s a starting upr with six independent layers. For all six, the Formula is the same simple Julia, and all use the same gradient. All start with “Gradient Coloring” in jlb.ucl. (This is exactly the same as using “Gradient Coloring” in Standard.ucl and using “Coloring” in jlb.ulb as the plug-in.) These are meant to illustrate the possibilities, not as finished images. Not all the features of “Coloring” will be covered.
SixLayers {
::RffApjn2tz1STxNOQ47UF/Hc5TJVtAWy2zjslPkQIZTKYDFM5CXmSjtmZUWP2G/AY+3vts9A
zDLL5FYhkoLJBrvuVrWfu1nEyZaKxPnE+u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jdEd86FL8MNa7+ZnE
zigMajz/lAKV0i8G22tNhLmt1zzusXwtLgusjweOut0LZSOt+SZqIhBxttuZpOMP11JrNnxw
WDskBuc7MnFH0GmsW/1gs5lwRW3FGPTKqI6tdJBVBvT5oSTWjYbpA+muHVt9q46211hTFBr9
dMWDd1Fk619tfS1dn1713uzw6tnp3e2zw2z6p/CC0fBB6Nnp3c2vZbOD3Dij8ngNnF8mreb5
+yg/B6tmNvvMhfqB2ennGHU4n/rznMwT7/f1Y/k+NC041lU/52+fVnMS/ZCo1J/LlO5/FYtv
k2M=
}
Update your Ultra Fractal formulas, as I’ve made major changes. Then open the upr and follow along. Change parameters to see how things really work. Experiment.
Layer 1 has no transform, the Distance plug-in is “Simple distance” in jlb.ulb, cabs is used for distance, only the last distance is used for coloring, and the final adjustment is Mandelbrot smoothing. The result is exactly the same as coloring using “Smooth (Mandelbrot)” in Standard.ucl, or using “Plug-In Coloring (Gradient)” in Standard.ucl and the “Smooth (Mandelbrot)” plug-in in Standard.ulb.
Complicated functions on the Formula tab are not needed to generate complicated images, as the remaining layers illustrate.
Layer 2 also has no transform and uses “Simple distance”, but at each pixel the smaller of the real and the imaginary values of Z is used for the distance. The largest and smallest are saved, the final coloring is the range, i.e. largest minus smallest.
Layer 3 uses the atan function as a transform, and the transformed value Z1 is used for distance. Again “Simple distance” is used, with real minus imaginary. The distance adjustment in the accumulation phase is log. Coloring is done with the smallest distance, and no final adjustment is used.
Layer 4 uses the “Martin +/-” transform in jlb.ulb. (The +/- indicates that the transform is based on Martin coloring in mt.ucl, and does more-or-less the same thing.) Z2 is calculated as the Geometric average of Z and Z1, i.e. the square root of Z times Z1, and is used for coloring. The distance plug-in is “Shapes” in jlb.ulb, with the Circle shape. In the final phase, the geometric average of all the distances is used, with a log final adjustment.
Layer 5 uses the sinh function as a transform, and Z2, the Harmonic average of Z and Z1, i.e. the reciprocal of the average of the reciprocals of Z times Z1, is used for coloring. The distance plug-in is “Lines2” in jlb.ulb, with the real part of Z2 used for distances from the line. The distance adjustment in the accumulation phase is log. Coloring is done with the ratio of the largest distance to the smallest distance, and the final adjustment is log.
Layer 6 uses the sqrt function as a transform. "Simple distance” uses the imaginary part of Z and Z1 to calculate two distances, and the product of the distances is used. Finally, the coloring uses the distance calculated at the first iteration.
Enjoy. Comments and suggestions are welcome.
Since my last post in February 2024,
https://www.ultrafractal.com/forum/index.php?u=/topic/919/gradient-coloring-plug-ins
I’ve been experimenting, seeing what seems worthwhile and what seems unnecessary. The plug-in successor to “Color by Distance” is “Coloring” in jlb.ulb.
The Coloring function on the Coloring tab is called by Ultra Fractal after each iteration of the function on the Formula tab. The Iteration part of the Coloring function can do whatever it likes with the current Z value (a complex number), often accumulating information to be used later. I call this the “Accumulation phase.” After the Formula iterations have finished, or bailed out, the Coloring function is called again to calculate an ordinary number that is an index into the gradient. I call this the “Final phase.”
In coloring files of type ucl, the “loop” section corresponds to the “Accumulation phase,” and the “final” section corresponds to the “Final phase.”
Typically actions of the Iteration (or loop) part of the Coloring function are to transform the Z value, making a new complex number Z1; saving one or more Z or Z1 values for later use; calculating a new Z2 from Z and Z1; calculating an ordinary number, d, from Z or Z1 or Z2; and saving one or more values of d for later use. Other actions include deciding whether to save anything about the iteration, based on such criteria as whether Z is in a certain range (is “orbit-trapped”), whether d is in a certain range, or whether this iteration is in a certain range.
I call this ordinary number, d, a Distance, as in some Coloring functions it is the same as the distance between two points in the complex plane.
The standard class that takes a Z value as input and generates a Z1 value is the UserTransform. (It’s defined in common.ulb but there’s no need for non-programmers to look at it.) It is the same class that is used as a plug-in on the Mapping tab, although not all UserTransforms that are useful on the Mapping tab are also useful on the Coloring tab, and vice versa.
UserTransforms can be found in Standard.ulb, dmj5.ulb, jlb.ulb, mmf.ulb, mt.ulb, om.ulb, reb.ulb, and thm.ulb.
Here’s a starting upr with six independent layers. For all six, the Formula is the same simple Julia, and all use the same gradient. All start with “Gradient Coloring” in jlb.ucl. (This is exactly the same as using “Gradient Coloring” in Standard.ucl and using “Coloring” in jlb.ulb as the plug-in.) These are meant to illustrate the possibilities, not as finished images. Not all the features of “Coloring” will be covered.
SixLayers {
::RffApjn2tz1STxNOQ47UF/Hc5TJVtAWy2zjslPkQIZTKYDFM5CXmSjtmZUWP2G/AY+3vts9A
zDLL5FYhkoLJBrvuVrWfu1nEyZaKxPnE+u93zwInlHS9MvkdnRIZJNNz04WWQ+cPE2yyYOlN
bee1/uqZvecr8TpBs8MPzvyWY8hwC6fO8Ic/jwWYXTDSUOjEyIZsoZeLpZ7vXppldnPJJnFH
5ZeK/RGITj4EiPLfpHC6iF085xBeLKCzZJkMwyFkkEwNV2SjyppeWHBAJzi8Q7v304UAMps5
Fk7Y82xuGJ0U/5U//xLe6UDSwPKyy5BixUWINisgPezJRBk0gDLmuwkbN470lw4pACcTjkxZ
UagH6oDOE824k4b5OG64kxTIsw4CeOZw+7xiyYB0qEZKJKbKALKOiakFHyC8cwDcd6542HSa
gN7iNkFRJp3ju/AstdPIR0Ug6Hueg+ZaENl5/5USADe0xxhxpQiqESyY/6f84QIL6Z+jwJHW
EO5df90PM+jrgibC7h3MeWlnLnQ2t1V/MvZB2XHSSRCsJOVA7aNE1bnmryJl0HjGacB9L5lJ
7dabKLFmuxNZG8H5eu78YyNzayRJ8n3ofKyojALaqppff0m57vPa83iofqIynT8NFYzm5dxg
qYOArvdYQAmqG01mEwoGhc7cm/cvzoRFicy0FqF+l4UKsKRq8ggje14Ab132SEqP5lddaLeJ
p+d8Gb86m5C1tCF24FkE0eymcCLEUb0UMaJvFGnkj8uqxeDaCzLOAvfkDmb8eIxQmRNFg1WV
sTDYwrObWIZ8lfUMWFYE1w+I8XkIfqHGhsQDbB66FMsFA6szFTVLBUOQ8JTyaBCMy2asahMb
Hvqj3MfCsebTltKbeKsyccqAmUJiFS8wC5ugFBpy8mcBvuKf+QQxtggFsIPrmeO5um7xAhhb
wYYlZv/GWtsJ7SuFWp/wdrVP1fLa4xWNvQGAUyrRTZRkQvzg1XphTSjzbMMqW5fnnvhKg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WzHw2aNfodp185YWKxJyq5DQUpmPIIdba0lXIhGNpL0oJdlG
NpT0oJKvMBAtj0oJKTjmoGNai8lJAMSXmgniglJelfRVOQxDYf4j6A2FdA/6zXXf+6v2OfdX
95rrPfd9lURfJV+97eejzYRzV+Sq8kca8/FJdRc0z8hxfKEMZ4XqDjHjdEd86FL8MNa7+ZnE
zigMajz/lAKV0i8G22tNhLmt1zzusXwtLgusjweOut0LZSOt+SZqIhBxttuZpOMP11JrNnxw
WDskBuc7MnFH0GmsW/1gs5lwRW3FGPTKqI6tdJBVBvT5oSTWjYbpA+muHVt9q46211hTFBr9
dMWDd1Fk619tfS1dn1713uzw6tnp3e2zw2z6p/CC0fBB6Nnp3c2vZbOD3Dij8ngNnF8mreb5
+yg/B6tmNvvMhfqB2ennGHU4n/rznMwT7/f1Y/k+NC041lU/52+fVnMS/ZCo1J/LlO5/FYtv
k2M=
}
Update your Ultra Fractal formulas, as I’ve made major changes. Then open the upr and follow along. Change parameters to see how things really work. Experiment.
Layer 1 has no transform, the Distance plug-in is “Simple distance” in jlb.ulb, cabs is used for distance, only the last distance is used for coloring, and the final adjustment is Mandelbrot smoothing. The result is exactly the same as coloring using “Smooth (Mandelbrot)” in Standard.ucl, or using “Plug-In Coloring (Gradient)” in Standard.ucl and the “Smooth (Mandelbrot)” plug-in in Standard.ulb.
Complicated functions on the Formula tab are not needed to generate complicated images, as the remaining layers illustrate.
Layer 2 also has no transform and uses “Simple distance”, but at each pixel the smaller of the real and the imaginary values of Z is used for the distance. The largest and smallest are saved, the final coloring is the range, i.e. largest minus smallest.
Layer 3 uses the atan function as a transform, and the transformed value Z1 is used for distance. Again “Simple distance” is used, with real minus imaginary. The distance adjustment in the accumulation phase is log. Coloring is done with the smallest distance, and no final adjustment is used.
Layer 4 uses the “Martin +/-” transform in jlb.ulb. (The +/- indicates that the transform is based on Martin coloring in mt.ucl, and does more-or-less the same thing.) Z2 is calculated as the Geometric average of Z and Z1, i.e. the square root of Z times Z1, and is used for coloring. The distance plug-in is “Shapes” in jlb.ulb, with the Circle shape. In the final phase, the geometric average of all the distances is used, with a log final adjustment.
Layer 5 uses the sinh function as a transform, and Z2, the Harmonic average of Z and Z1, i.e. the reciprocal of the average of the reciprocals of Z times Z1, is used for coloring. The distance plug-in is “Lines2” in jlb.ulb, with the real part of Z2 used for distances from the line. The distance adjustment in the accumulation phase is log. Coloring is done with the ratio of the largest distance to the smallest distance, and the final adjustment is log.
Layer 6 uses the sqrt function as a transform. "Simple distance” uses the imaginary part of Z and Z1 to calculate two distances, and the product of the distances is used. Finally, the coloring uses the distance calculated at the first iteration.
Enjoy. Comments and suggestions are welcome.