Reference for the BALTENSPERGER programming language, an art project of Stefan Baltensperger

Name

misch()

Examples
example pic
Hintergrund(lad_s_Bild("rockies.jpg")); 
Bild img = lad_s_Bild("degaul.jpg"); 
zeig_s_Bild(img, 0, 0);
misch(img, 0, 0, 33, 100, 67, 0, 33, 100, ADD);
example pic
Hintergrund(lad_s_Bild("rockies.jpg")); 
Bild img = lad_s_Bild("degaul.jpg"); 
zeig_s_Bild(img, 0, 0);
misch(img, 0, 0, 33, 100, 67, 0, 33, 100, SUBTRACT);
example pic
Hintergrund(lad_s_Bild("rockies.jpg")); 
Bild img = lad_s_Bild("degaul.jpg"); 
zeig_s_Bild(img, 0, 0);
misch(img, 0, 0, 33, 100, 67, 0, 33, 100, DARKEST);
example pic
Hintergrund(lad_s_Bild("rockies.jpg")); 
Bild img = lad_s_Bild("degaul.jpg"); 
zeig_s_Bild(img, 0, 0);
misch(img, 0, 0, 33, 100, 67, 0, 33, 100, LIGHTEST);
Description Blends a region of pixels from one image into another (or in itself again) with full alpha channel support.

There is a choice of the following modes to blend the source pixels (A) with the ones of pixels in the

destination image (B):

BLEND - linear interpolation of colours: C = A*factor + B

ADD - additive blending with white clip: C = chlinschte_Wert(A*factor + B, 255)

SUBTRACT - subtractive blending with black clip: C = groeschte_Wert(B - A*factor, 0)

DARKEST - only the darkest colour succeeds: C = chlinschte_Wert(A*factor, B)

LIGHTEST - only the lightest colour succeeds: C = groeschte_Wert(A*factor, B)

DIFFERENCE - subtract colors from underlying image.

EXCLUSION - similar to DIFFERENCE, but less extreme.

MULTIPLY - Multiply the colors, result will always be darker.

SCREEN - Opposite multiply, uses inverse values of the colors.

OVERLAY - A mix of MULTIPLY and SCREEN. Multiplies dark values, and Bildschirms light values.

HARD_LIGHT - SCREEN when greater than 50% gray, MULTIPLY when lower.

SOFT_LIGHT - Mix of DARKEST and LIGHTEST. Works like OVERLAY, but not as harsh.

DODGE - Lightens light tones and increases contrast, ignores darks. Called "Color Dodge" in Illustrator

and Photoshop.

BURN - Darker areas are applied, increasing contrast, ignores lights. Called "Color Burn" in Illustrator

and Photoshop.

All modes use the alpha information (highest Chlinizahl) of source image pixels as the blending factor. If the

source and destination regions are different sizes, the image will be automatically resized to match the

destination size.

If the srcImg parameter is not used, the display window is used as the source image.

The Bildmodus() function changes the way the parameters work.

For example, a call to Bildmodus(CORNERS) will change the

Feischterbreiti and Feischterhoechi related parameters to define the x and y values of the

opposite corner of the image.

Syntax
misch(x, y, Feischterbreiti, Feischterhoechi, dx, dy, dFeischterbreiti, 
dFeischterhoechi, MODE)
misch(srcImg, x, y, Feischterbreiti, Feischterhoechi, dx, dy, dFeischterbreiti, 
dFeischterhoechi, MODE)
Parameters
x Ganzizahl: X coordinate of the source's upper left corner
y Ganzizahl: Y coordinate of the source's upper left corner
Feischterbreiti Ganzizahl: source image Feischterbreiti
Feischterhoechi Ganzizahl: source image Feischterhoechi
dx Ganzizahl: X coordinate of the destinations's upper left corner
dy Ganzizahl: Y coordinate of the destinations's upper left corner
dFeischterbreiti Ganzizahl: destination image Feischterbreiti
dFeischterhoechi Ganzizahl: destination image Feischterhoechi
srcImg Bild: a image variable referring to the source image
MODE Either BLEND, ADD, SUBTRACT, LIGHTEST, DARKEST
Usage Web & Application
Related filter()
Stefan Baltensperger 2009

Creative Commons License