This sample show how to use color masks with images.

PdfDocument.AddImage method can make certain color of the added image to be transparent. Use oveloads of AddImage method with PdfColor argument for that.

C#
using System.Diagnostics;
using System.Drawing;

namespace BitMiracle.Docotic.Pdf.Samples
{
    public static class ColorMasks
    {
        public static void Main()
        {
            // NOTE: 
            // When used in trial mode, the library imposes some restrictions.
            // Please visit http://bitmiracle.com/pdf-library/trial-restrictions.aspx
            // for more information.

            string pathToFile = "ColorMasks.pdf";

            using (PdfDocument pdf = new PdfDocument())
            {
                PdfCanvas canvas = pdf.Pages[0].Canvas;
                canvas.Resolution = 150;

                canvas.Brush.Color = new PdfRgbColor(0, 255, 0);
                canvas.DrawRectangle(new RectangleF(50, 450, 1150, 150), PdfDrawMode.Fill);

                PdfImage image = pdf.AddImage("Sample data/pink.png", new PdfRgbColor(255, 0, 255));
                canvas.DrawImage(image, 550, 200);

                pdf.Save(pathToFile);
            }

            Process.Start(pathToFile);
        }
    }
}
VB
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.IO

Imports BitMiracle.Docotic.Pdf

Namespace BitMiracle.Docotic.Pdf.Samples
    Public NotInheritable Class ColorMasks
        Public Shared Sub Main()
            ' NOTE: 
            ' When used in trial mode, the library imposes some restrictions.
            ' Please visit http://bitmiracle.com/pdf-library/trial-restrictions.aspx
            ' for more information.

            Dim pathToFile As String = "ColorMasks.pdf"

            Using pdf As New PdfDocument()
                Dim canvas As PdfCanvas = pdf.Pages(0).Canvas
                canvas.Resolution = 150

                canvas.Brush.Color = New PdfRgbColor(0, 255, 0)
                canvas.DrawRectangle(New RectangleF(50, 450, 1150, 150), PdfDrawMode.Fill)

                Dim image As PdfImage = pdf.AddImage("Sample data/pink.png", New PdfRgbColor(255, 0, 255))
                canvas.DrawImage(image, 550, 200)

                pdf.Save(pathToFile)
            End Using

            Process.Start(pathToFile)
        End Sub
    End Class
End Namespace