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
Arithmetic
Conversion
Color
rgb
rgba
hsl
hsla
red
green
blue
alpha
hue
sat
lum
blend
compose
gradient
merge
Trigonometric
Miscellaneous
Control Structures
Compiler Directives
Functions
Interface to ChaosPro
Special Features, Notes...
Compatibility
Fractal Type Reference
Tutorials
Appendix
CHAOSPRO 4.0
Release 4.0
.

Predefined Functions - merge<type>

Function name:merge<type>
Synopsis:merge<type>(color1,color2)

Input data type Output data type
color, color color


Description:

These functions perform the layer merging operations: They do just the same as the layer merging operations, so by using these functions you can reproduce how the layers in ChaosPro are merged to form the resulting image:

Suppose you have two colors, the base color col1 and the merge color col2, using opacity opacity. Then use the following statement to reproduce the layer merging:

compose(col1, blend(col2, merge<type>(col1, col2), alpha(col1)), opacity)

The following merge functions exist:
FunctionMeaning
mergenormalThe resulting color is a mix between the base color and the merge color. Factor defines the exact mix: 0 means base color, 100 means merge color. By increasing Factor from 0 to 100 you get a smooth color range from base color to merge color. In other words: It lets you lay over one layer where the underlying layers "shine through".
mergemultiplyMultiplicates base and merge color on rgb basis. This means as soon as one component is 0, the resulting component will be 0, too. This darkens the image.
mergescreenLightens the image by multiplying the inverse colors: This lightens the image.
mergeoverlayMultiplicates  or screens  the base and merge color on rgb bases: If the base color component is less than 128, it screens, otherwise it multiplies.
mergesoftlightThis mode takes the base color as basis and darkens or lightens it according to the blend color. The resulting image looks like the base image with darker and lighter regions according to the blend image.
mergehardlightMultiplicates  or screens  the base and merge color on rgb bases (similar to Overlay): But the logic is invers.
mergedarkenDarkens the base image according to the merge image (by taking the smaller rgb color component).
mergelightenLightens the base image according to the merge image (by taking the bigger rgb color component).
mergedifferenceReturns the difference between the base color and the merge color (on rgb basis).
mergehueReplaces the hue of the base color with the hue of the merge color.
mergesaturationReplaces the saturation of the base color with the saturation of the merge color.
mergecolorReplaces the hue and saturation of the base color with the hue and saturation of the merge color.
mergeluminanceReplaces the luminance of the base color with the luminance of the merge color.
mergeadditionAdds the base and merge color on rgb basis.
mergesubtractionSubtracts the merge color from the base color on rgb basis.
mergehsladditionAdds base and merge color on hsl basis.
mergeredReplaces the red component of the base color with the red component of the merge color.
mergegreenReplaces the green component of the base color with the green component of the merge color.
mergeblueReplaces the blue component of the base color with the blue component of the merge color.