Blending Modes

One of the major Graphics Mill features is the ability to combine multiple images into a single image. The basics of combining images, including code snippets, are presented in the Overlaying Images topic. Everything is pretty simple if you just need to place one image on top of another, but things become much more interesting if you want to blend images. This topic sheds light on how images can be blended in Graphics Mill with the following blending modes:

In this topic, the source image refers to the base bitmap and the overlaying image refers to the bitmap added on top. The following two images are used throughout the topic to demonstrate blending modes:

Source bitmap Overalying bitmap
Source bitmap Overlaying bitmap

The overlaying bitmap comes with two levels of transparency. The background is completely transparent and the yellow part comes with an opacity level of 0.7 (70%). To reproduce the image blending, you can use the following code snippet:

C#
using (var sourceImage = new Aurigma.GraphicsMill.Bitmap(@"Images\OverlaySource.jpg"))
using (var topImage = new Aurigma.GraphicsMill.Bitmap(@"Images\Overlaying.png"))
{
    //Create the Blender transform with the ColorBurn blending mode.
    var blender = new Aurigma.GraphicsMill.Transforms.Blender(
        Aurigma.GraphicsMill.Transforms.BlendMode.ColorBurn);

    blender.TopImage = topImage;

    //Resulting collage.
    var collage = blender.Apply(sourceImage);
    collage.Save(@"Images\Output\ColorBurn.jpg");
}

ColorBurn

Divides the inverted bottom layer by the top layer, and then inverts the result. It is darker than Multiply, with more highly saturated mid-tones and reduced highlights.

The ColorBurn blending mode
Bitmaps that are blended using the ColorBurn mode.

ColorDodge

Divides the bottom layer by the inverted top layer. It is brighter than the Screen blending mode. Results in an intense color with high contrast, typically with saturated mid-tones and blown highlights.

The ColorDodge blending mode
Bitmaps that are blended using the ColorDodge mode.

Darken

Creates a pixel that retains the smallest components of the foreground and background pixels. If the pixels of the selected layer are darker than the ones in the layers below, they are kept in the image. If the pixels in the layer are lighter, they are replaced with the tones in the layers below.

The Darken blending mode
Bitmaps that are blended using the Darken mode.

Difference

Subtracts the bottom layer from the top layer, or vice versa, to get a positive value. Subtracts a pixel in the active layer from an equivalent pixel in the composite view of the underlying layer, resulting in only absolute numbers.

The Difference blending mode
Bitmaps that are blended using the Difference mode.

Exclusion

Subtracts the bottom layer from the top layer or vice versa to get a positive value. The subtraction never produces a negative number. The contrast is less than in the Difference mode.

The Exclusion blending mode
Bitmaps that are blended using the Exclusion mode.

HardLight

Uses a combination of the Linear Dodge blending mode on the lighter pixels, and the Linear Burn blending mode on the darker pixels. It uses a half-strength application of these modes and logic similar to the Overlay blending mode, but favors the active layer, as opposed to the underlying layers.

The HardLight blending mode
Bitmaps that are blended using the HardLight mode.

Lighten

Selects the maximum of each component from the foreground and background pixels. If the pixels of the overlaying image are lighter than the ones in the source image, they are kept in the image. If the pixels in the overlaying image are darker, they are replaced with the pixels in the source image (they show through to the selected layer).

The Lighten blending mode
Bitmaps that are blended using the Lighten mode.

Multiply

Multiplies pixels from the top image with the corresponding pixels in the bottom image. Works by multiplying the luminance levels of the pixels.

The Multiply blending mode
Bitmaps that are blended using the Multiply mode.

Normal

The normal mode where no math is applied.

The Normal blending mode
Bitmaps that are blended using the Normal mode.

Overlay

Uses a combination of the Screen blending mode on the lighter pixels, and the Multiply blending mode on the darker pixels. It uses a half-strength application of these modes, and the mid-tones (50% gray) become transparent.

The Overlay blending mode
Bitmaps that are blended using the Overlay mode.

Screen

The pixels in the two layers are inverted, multiplied, and then inverted again. Similar to the Lighten blending mode, but brighter, and removes more of the dark pixels, resulting in smoother transitions.

The Screen blending mode
Bitmaps that are blended using the Screen mode.

SoftLight

Uses a combination of the Screen blending mode on the lighter pixels, and the Multiply blending mode on the darker pixels (a half-strength application of both modes).

The SoftLight blending mode
Bitmaps that are blended using the SoftLight mode.

See Also

Reference

Manual