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. You can apply the following blending modes, which are also available in PDF and Photoshop:
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 | 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:
using (var sourceImage = new Bitmap(@"Images\OverlaySource.jpg")) using (var topImage = new Bitmap(@"Images\Overlaying.png")) { //Create the Blender transform with the ColorBurn blending mode. var blender = new Blender(Aurigma.GraphicsMill.Transforms.BlendMode.ColorBurn); blender.TopImage = topImage; //Resulting collage. var collage = blender.Apply(sourceImage); collage.Save(@"Images\Output\ColorBurn.jpg"); }
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.
Bitmaps that are blended using the ColorBurn mode. |
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.
Bitmaps that are blended using the ColorDodge mode. |
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.
Bitmaps that are blended using the Darken mode. |
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.
Bitmaps that are blended using the Difference mode. |
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.
Bitmaps that are blended using the Exclusion mode. |
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.
Bitmaps that are blended using the HardLight mode. |
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).
Bitmaps that are blended using the Lighten mode. |
Multiplies pixels from the top image with the corresponding pixels in the bottom image. Works by multiplying the luminance levels of the pixels.
Bitmaps that are blended using the Multiply mode. |
The normal mode where no math is applied.
Bitmaps that are blended using the Normal mode. |
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.
Bitmaps that are blended using the Overlay mode. |
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.
Bitmaps that are blended using the Screen mode. |
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).
Bitmaps that are blended using the SoftLight mode. |