
Adobe’s widely-used Photoshop application employs the PSD (Photoshop Document) format for its native image files. This format is essential for creating intricate designs such as logos and brochures, often comprising multiple layers. To effectively protect your designs, you can programmatically add a watermark to a PSD file in C#. This article will guide you through the process using the Aspose.PSD for .NET API, a powerful solution for C# ASP.NET Core PSD to TIFF conversion and other PSD image manipulation in ASP.NET tasks.
What You Will Learn
In this article, we will cover the following topics:
- Using the C# Photoshop API to Add Watermark to PSD
- Adding a Text Watermark to PSD
- Creating a Diagonal Watermark in PSD
- Adding an Image Watermark to PSD
Using the C# Photoshop API to Add Watermark to PSD
To programmatically add a text or image watermark to a PSD file, we will utilize the Aspose.PSD for .NET API. This powerful and user-friendly library allows you to manipulate Adobe Photoshop file formats without needing Adobe Photoshop itself. It is ideal for C# .NET Core PSB to PDF conversion and supports various operations such as compression, rotation, and rendering across multiple supported file formats.
Key Classes in the API
- PsdImage: Used to load, edit, and save PSD files.
- Graphics: Represents the graphics context in the image.
- Layer: Represents each layer within the PSD file.
Installation
You can either download the DLL or install it via NuGet:
PM> Install-Package Aspose.PSD
Adding a Text Watermark to PSD using C#
To add a text watermark to a PSD file, follow these steps:
- Load the PSD file as a PsdImage using the Image class.
- Create an instance of the Graphics class.
- Define a Font object for the watermark text.
- Create a SolidBrush instance with your desired color.
- Specify string alignment.
- Call the DrawString() method to render the text.
- Save the output file using the Save() method.
Here’s a code sample demonstrating how to add a text watermark to a PSD file in C#:

Add Text Watermark to PSD using C#
To save the output as a PSD file, use the following code snippet:
psdImage.Save(@"C:\Files\AddWatermark_output.psd", new PsdOptions());
Creating a Diagonal Watermark in PSD using C#
To create a diagonal text watermark in a PSD file, follow these steps:
- Load the PSD file as a PsdImage using the Image class.
- Create an instance of the Graphics class.
- Define a Font object for the watermark.
- Create a SolidBrush instance with your desired color.
- Specify a transform matrix to rotate the watermark.
- Set string alignment.
- Call the DrawString() method.
- Save the output file using the Save() method.
The following code sample shows how to add a diagonal text watermark to a PSD file in C#:

Create Diagonal Watermark in PSD using C#
Adding an Image Watermark to PSD using C#
To add an image as a watermark to a PSD file, follow these steps:
- Load the PSD file as a PsdImage using the Image class.
- Create an instance of the Layer class.
- Set the layer’s height, width, and opacity.
- Use the AddLayer() method to add the layer to the PSD.
- Load the watermark image into the layer.
- Call the DrawImage() method, passing the location and watermark image layer as arguments.
- Save the output file using the Save() method.
Here’s a code sample demonstrating how to add an image watermark to a PSD file in C#:

Add Image Watermark to PSD using C#
Get a Free Temporary License
You can get a free temporary license to try Aspose.PSD for .NET without any evaluation limitations.
Conclusion
In this article, we’ve explored how to:
- Add a new layer to a PSD image.
- Add text or image watermarks to the PSD.
- Save the PSD as a PNG or PSD file using C#.
Beyond learning how to add a watermark to a PSD file in C#, you can delve deeper into Aspose.PSD for .NET by checking the documentation and exploring its extensive features. If you have any questions, feel free to reach out on our free support forum.
By utilizing the Aspose.PSD Plugin, you can efficiently manipulate PSD files and implement watermarking in your C# .NET applications, making it the best way to watermark PSD files in C# .NET. Whether you’re looking to add a transparent watermark to PSD or batch watermark PSD files in C# .NET, this guide provides the foundational knowledge you need to get started with C# PSD editing library and C# .NET Core PSD to BMP conversion capabilities.