# Blending modes description

While we can mathematically obtain values below 0 or above 1 through blending modes, these ones will respectively be capped to 0 and 1.

This makes sense as we cannot represent colors darker than pure black or brighter than pure white.

Here the available blending modes with the Blend nodes and what they exactly do:

## Copy

The Copy blending mode will just place the foreground on top of the background.

It is getting useful in these cases:

• If you play with opacity slider
• if the foreground input has an alpha
• if you use an opacity mask

The result is influenced by the "alpha blending" parameter

The Add blending mode will add the foreground input value to each corresponding pixel in the background.

## Substract

The Substract blending mode will substract the foreground input value from each corresponding pixel in the background.

If the result of the substraction is lower than 0, the value is capped to 0, resulting pure black.

## Multiply

The Multiply blending mode will multiply the background input value by each corresponding pixel in the foreground.

As the value of each pixel is comprised between 0 and 1, the result is always equal or lower (darker) compared to the original.

The Add Sub blending mode works as following:

• Foreground pixels with a value higher than 0.5 are added to their respective background pixels.
• Foreground pixels with a value lower than 0.5 are substracted from their respective background pixels.

## Max (Lighten)

The Max Blending mode will pick the higher value between the background and the foreground.

## Min (Darken)

The Min Blending mode will pick the lower value between the background and the foreground.

## Switch

The Switch blending mode will blend the background and the foreground according to the opacity

• the closer we get to 0, the more we will see the background
• The closer we get to 1, the more we will see the foreground

Optimization tip

The switch mode can be used to improve the performances of your graph:

• if the opacity paramater is set to 0, anything connected to the foreground won't be computed
• if the opacity paramater is set to1, anything connected to the background won't be computed

The library contains graph instances called "Switch" and "Switch Grayscale" that are setup to use the blend nodes in these specific configurations.

While switch mode looks really similar to copy mode, they remain different:

• In copy mode it's just the background "covering" the foreground
• In switch mode, we melt together the both inputs, deciding which one is more influent.

## Divide

The Divide blending mode will divide the background input pixels value by each corresponding pixel in the foreground.

## Overlay

The Overlay blending mode combines Multiply and Screen blend modes:

• If the value of the lower layer pixel is below 0.5, then a Multiply type blending is applied
• If the value of the lower layer pixel is above 0.5, then a Screen type blending is applied

## Screen

With Screen blend mode the values of the pixels in the two inputs are inverted, multiplied, and then inverted again.

The result is the opposite effect to multiply and is always equal or higher (brighter) compared to the original.

## Soft Light

The Soft Light blend mode creates a subtle lighter or darker result depending on the brightness of the foreground color.

Blend colors that are more than 50% brightness will lighten the background pixels and colors that are less than 50% brightness will darken the background pixels.