ChaosPro Home
Introduction
What's New
Palettes
Using Formulas
Layering in ChaosPro
Rendering
Fractal Parameter Windows
Windows
Menu
3D Transformations
Animations
Formula Compiler
Writing Formulas
Language Reference
Introduction
Basic Syntax
Datatypes
Constants
Variables
Expressions
Operators
Functions
Control Structures
Compiler Directives
Functions
Interface to ChaosPro
Special Features, Notes...
Alpha Channel
Hints and Tips
Compatibility
Fractal Type Reference
Tutorials
Appendix
CHAOSPRO 4.0
Release 4.0
.

Alpha Channel

A new feature in ChaosPro 3.0 is the so called alpha channel. An alpha channel is a layer of a 2D image which (in ChaosPro) for each pixel contains values ranging from 0 to 1:

  • 0 means: pixel is transparent.
  • 1 means: pixel is opaque.

As you can imagine, it doesn't make much sense to define that a pixel is, for example, half-transparent, if there isn't something "behind" it that shines through.
So the alpha channel is useful only when you create a Layered Fractal and add that fractal to it as a layer. That way you can put some other layer behind, which then shines through the above layer.

A short example:

Suppose you have a Layered Fractal consisting of a standard Mandelbrot set and "behind" the Mandelbrot set there is a standard Julia set.
Initially the transparency factor of the Mandelbrot layer in the parameter window of the "Layered Fractal" is set to 1 (the window will display 100, i.e. 100%).

 What does this mean? That means, all pixels of the Mandelbrot set have a transparency value of 1, which means "opaque", which actually means: You won't see anything from the Julia set behind.

Now decrease that factor to 0.5 (i.e. 50, i.e. 50%) : You will see that now the Mandelbrot set seems to be half-transparent, the Julia set "shines through" the layer in front of it.

Now what would an alpha channel exactly do?
Basically the alpha channel does the same as the parameter "factor": It specifies the transparency. The only difference is that the "factor" is a global setting, which gets applied to all pixels of the layer in the same way (regardless the color, the position, regardless whether the pixel is "inside" or "outside"), whereas the alpha channel allows you to influence the transparency of each pixel separately.

In our example it is now possible to change the transparency of the boring black Mandelbrot sea: We can make it transparent, thus the layer behind containing the Julia set shines through: We can define that the transparency of the inner region of the Mandelbrot set is 0, whereas all other pixels outside the set remain opaque.

To do that we only need to change the inner coloring formula: Each inner pixel needs an assignment like "alpha=0". That's all

You can do many more things using an alpha channel. How about the following ideas?

  • Every second pixel is transparent (using the function whitesq). This allows you to "mix" two layers: Every second pixel comes from the layer behind.
  • Define a circular region in the middle of the window where the alpha channel smoothly increases from 0 (midpoint of circle) to 1 (radius of circle).
  • Set the transparency to 0 for each second iteration band.
  • Set the transparency to some random value for a grey image and place a nice image behind that boring image: It will look like there's some "fog".


Notes:
  • The pixel elimination algorithm, which speeds up the fractal calculation by guessing pixels principally takes care of the alpha channel. But under some circumstances it may guess wrong.
    So I would recommend to temporarily switch off "elimination" when using the alpha channel feature: Compare the image before and after to see whether it seems to be identical. If yes, you can switch on "elimination" again.
  • Periodicity checking logic is a quite complicated task, but it speeds up the calculation: The main drawback is that some coloring algorithms and especially the alpha channel feature may be influenced in a non predictable way. So please compare your image with periodicity checking on and off to see whether they are identical.
  • The resulting "factor" of a pixel when using the alpha channel is "factor" (Layered Fractal: parameter window 1) mutiplied by "alpha-value". So if "factor" equals to 1 (window will display 100), the alpha channel is used in its original form. Using "factor" you can scale the alpha channel.
    So if you change the merge type from "Normal" to any other value, "alpha" is not used for transparency, instead, it is used for "darken" or "lighten" or whatever merge type you have chosen: Basically only "alpha*factor" gets calculated for each pixel, then the pixel gets merged using the chosen merge type.