Add Watermark to Images using C#

Let’s see today, how to add watermarks to images. This helps you brand your official photography, and protects your pictures from any unauthorized use. This article will guide you to programmatically add text and image watermarks to your image files using C#. In an earlier post, we have seen the same to add text and image-based watermarks to images using Java. After reading this article, it will not be difficult for you to add watermarks to JPG/JPEG, PNG, WebP, GIF, TIFF, JP2, BMP images using C# within your .NET application.

Let’s now separately see, how we can easily add text and image-based watermarks on your pictures, photos, or image files in C# using the .NET Watermarking API for documents and images.

Text and Image Watermarking API for .NET

Watermark API for .NET - GroupDocs

GroupDocs.Watermark for .NET is an API for adding watermarks to the images or documents of different file formats within .NET applications. It provides effective watermarking methods that allow you to add text watermarks as well as image watermarks that are hard to get automatically removed by other third-party tools.

From the documentation, you may further check the features and supported file formats.

You can download the DLLs or MSI installer from the downloads section or get it from NuGet.

Install-Package GroupDocs.Watermark

Add Text to Images as Watermark using C#

Add Text Watermark to PNG image using Java and .NET

The API allows you to add text to images as a watermark with many customizations. The following steps guide how we can apply watermark on our images files, photos, or pictures using C# within the .NET application.

  1. Load the Image using Watermarker.
  2. Set the watermark text and style using TextWatermark.
  3. Set other watermark properties like position, rotation, opacity, etc.
  4. Add the text watermark to the image using the Add method.
  5. Save the output image with Save method.

The following C# code sample adds a text label on a JPG image as a watermark with some text rotation.

Insert Image Watermark to Images using C#

Add Image Watermark to JPG image using GroupDocs.Watermark

Similarly, we can also add another image as a watermark on our source image files. For this, use ImageWatermark class and its properties to customize the watermark appearance.

  • Create Watermarker class object to load the source image.
  • Prepare image watermark using ImageWatermark class.
  • Set the watermark properties.
  • Add the image watermark on the source image using Add method.
  • Save the output image using Save method.

The following C# code sample adds a PNG image on another PNG file as a watermark on the preferred location.

Conclusion

I am confident that you can now easily add a watermark to your image files using C#. Even you can build your own .NET application that supports watermarking the documents and images of various file formats.

You can have a Free Temporary License to experience every aspect of the product. Free support will be happy to get you out of any confusion and resolve your watermark-related queries on the forum.

See Also