VintaSoft Imaging .NET SDK 15.1: Documentation for .NET developer
Vintasoft.Imaging Namespace / BlendingMode Enumeration
Syntax Members Example Hierarchy Requirements SeeAlso
In This Topic
BlendingMode Enumeration
In This Topic
Specifies available color blending modes.
Syntax
'Declaration

Public Enum BlendingMode
   Inherits System.Enum

public enum BlendingMode : System.Enum

Members
MemberDescription
NormalSelects the source color, ignoring the backdrop.
MultiplyMultiplies the backdrop and source color values.
ScreenMultiplies the complements of the backdrop and source color values, then complements the result.
OverlayMultiplies or screens the colors, depending on the backdrop color value. Source colors overlay the backdrop while preserving its highlights and shadows. The backdrop color is not replaced but is mixed with the source color to reflect the lightness or darkness of the backdrop.
DarkenSelects the darker of the backdrop and source colors.
LightenSelects the lighter of the backdrop and source colors.
ColorDodgeBrightens the backdrop color to reflect the source color. Painting with black produces no changes.
ColorBurnDarkens the backdrop color to reflect the source color. Painting with white produces no change.
HardLightMultiplies or screens the colors, depending on the source color value. The effect is similar to shining a harsh spotlight on the backdrop.
SoftLightDarkens or lightens the colors, depending on the source color value. The effect is similar to shining a diffused spotlight on the backdrop
DifferenceSubtracts the darker of the two constituent colors from the lighter color.
ExclusionProduces an effect similar to that of the Difference mode but lower in contrast. Painting with white inverts the backdrop color; painting with black produces no change.
HueCreates a color with the hue of the source color and the saturation and luminosity of the backdrop color.
SaturationCreates a color with the saturation of the source color and the hue and luminosity of the backdrop color. Painting with this mode in an area of the backdrop that is a pure gray (no saturation) produces no change.
ColorCreates a color with the hue and saturation of the source color and the luminosity of the backdrop color. This preserves the gray levels of the backdrop and is useful for coloring monochrome images or tinting color images.
LuminosityCreates a color with the luminosity of the source color and the hue and saturation of the backdrop color. This produces an inverse effect to that of the Color mode.
BrightnessSelects the brightness of the backdrop and source colors.
ContrastSelects the contrast of the backdrop and source colors.
GammaSelects the gamma of the backdrop and source colors.
MinSelects the min of the backdrop and source colors.
MaxSelects the max of the backdrop and source colors.
SumSum of the backdrop and source colors.
SubSub of the backdrop and source colors.
DivisionDivides the backdrop and source color values.
Example

This C#/VB.NET code shows how to load an image from disk, blend the colors in the specified region of the image and save the result to a new image file.


Class ColorBlendCommandExample
    Public Sub ProcessImage()
        ' [ do not forget to set your image file path here! ]
        ' create an image collection
        Using images As New Vintasoft.Imaging.ImageCollection()
            ' add image to the image collection
            images.Add("Flower.jpg")
            Try
                ' create the image processing command
                Dim command As New Vintasoft.Imaging.ImageProcessing.Color.ColorBlendCommand(Vintasoft.Imaging.BlendingMode.SoftLight, System.Drawing.Color.White)

                ' subscribe to progress event of image processing command
                AddHandler command.Progress, New System.EventHandler(Of Vintasoft.Imaging.ImageProcessing.ImageProcessingProgressEventArgs)(AddressOf command_Progress)

                Try
                    ' for each image in image collection
                    For Each image As Vintasoft.Imaging.VintasoftImage In images
                        ' set the region-of-interest to the left part of the image
                        command.RegionOfInterest = New Vintasoft.Imaging.RegionOfInterest(0, 0, image.Width \ 2, image.Height)
                        ' apply the image processing command to the image
                        command.ExecuteInPlace(image)
                    Next
                Catch ex As Vintasoft.Imaging.ImageProcessing.ImageProcessingException
                    ' show error message
                    System.Windows.Forms.MessageBox.Show(ex.Message)
                    Return
                End Try

                ' save the processed image collection to a new TIFF file
                images.SaveSync("processed-image.tif")
            Finally
                images.ClearAndDisposeItems()
            End Try
        End Using

    End Sub

    Private Sub command_Progress(sender As Object, e As Vintasoft.Imaging.ImageProcessing.ImageProcessingProgressEventArgs)
        ' update progress info using e.Progress property
        ' ...

        ' cancel execution of command using e.Cancel property if necessary
        ' ...
    End Sub
End Class


class ColorBlendCommandExample
{
    public void ProcessImage()
    {
        // [ do not forget to set your image file path here! ]
        // create an image collection
        using (Vintasoft.Imaging.ImageCollection images = new Vintasoft.Imaging.ImageCollection())
        {
            // add image to the image collection
            images.Add("Flower.jpg");
            try
            {
                // create the image processing command
                Vintasoft.Imaging.ImageProcessing.Color.ColorBlendCommand command =
                    new Vintasoft.Imaging.ImageProcessing.Color.ColorBlendCommand(
                        Vintasoft.Imaging.BlendingMode.SoftLight,
                        System.Drawing.Color.White);

                // subscribe to progress event of image processing command
                command.Progress +=
                    new System.EventHandler<Vintasoft.Imaging.ImageProcessing.ImageProcessingProgressEventArgs>(command_Progress);

                try
                {
                    // for each image in image collection
                    foreach (Vintasoft.Imaging.VintasoftImage image in images)
                    {
                        // set the region-of-interest to the left part of the image
                        command.RegionOfInterest = new Vintasoft.Imaging.RegionOfInterest(0, 0, image.Width / 2, image.Height);
                        // apply the image processing command to the image
                        command.ExecuteInPlace(image);
                    }
                }
                catch (Vintasoft.Imaging.ImageProcessing.ImageProcessingException ex)
                {
                    // show error message
                    System.Windows.Forms.MessageBox.Show(ex.Message);
                    return;
                }

                // save the processed image collection to a new TIFF file
                images.SaveSync("processed-image.tif");
            }
            finally
            {
                images.ClearAndDisposeItems();
            }
        }

    }

    void command_Progress(object sender, Vintasoft.Imaging.ImageProcessing.ImageProcessingProgressEventArgs e)
    {
        // update progress info using e.Progress property
        // ...

        // cancel execution of command using e.Cancel property if necessary
        // ...
    }
}

Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         Vintasoft.Imaging.BlendingMode

Requirements

Target Platforms: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

See Also