Add watermarks to images

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Watermark MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-watermark -- dnx GroupDocs.Watermark.Mcp --yes
Folders, licensing and more →

GroupDocs.Watermark adds watermarks to raster images, including multi-frame formats such as TIFF and GIF. For multi-frame images, open the file with the format-specific load options and target a frame with the matching watermark option.

Add a watermark to a particular frame

Open a TIFF with TiffImageLoadOptions and use TiffImageWatermarkOptions with frame_index to watermark a specific frame.

from groupdocs.watermark import Watermarker
from groupdocs.watermark.watermarks import TextWatermark, Font, Color
from groupdocs.watermark.common import HorizontalAlignment, VerticalAlignment
from groupdocs.watermark.options.image import TiffImageLoadOptions, TiffImageWatermarkOptions

def add_watermark_to_image():
    with Watermarker("./image.tiff", TiffImageLoadOptions()) as watermarker:
        watermark = TextWatermark("CONFIDENTIAL", Font("Arial", 19.0))
        watermark.foreground_color = Color.red
        watermark.horizontal_alignment = HorizontalAlignment.CENTER
        watermark.vertical_alignment = VerticalAlignment.CENTER

        options = TiffImageWatermarkOptions()
        options.frame_index = 0
        watermarker.add(watermark, options)

        watermarker.save("./output.tiff")

if __name__ == "__main__":
    add_watermark_to_image()

image.tiff is the sample file used in this example. Click here to download it.

Binary file (TIFF, 1.4 MB)

Download full output

For a single-frame image (BMP, PNG, JPEG), open it directly with Watermarker("photo.png") and add the watermark without frame options. To watermark the images embedded inside a document, see Adding watermark to images inside a document.