Skip to content

Conversation

@sawyer-shi
Copy link
Contributor

@sawyer-shi sawyer-shi commented Jan 20, 2026

File Watermark

A powerful Dify plugin providing comprehensive local file watermarking capabilities. All watermarking operations are performed entirely on your local machine without requiring any external services, API keys, or internet connection, ensuring maximum data security and privacy. Supports adding text and icon watermarks to PDF, Word, PPT, Excel, Image, and Video files with customizable parameters including position, opacity, color, font size, scale, and alignment.

Version Information

  • Current Version: v0.0.1
  • Release Date: 2026-01-01
  • Compatibility: Dify Plugin Framework
  • Python Version: 3.12

Version History

  • v0.0.1 (2026-01-01): Initial release with text and icon watermarking capabilities

Quick Start

  1. Download the file_watermark plugin from the Dify marketplace
  2. Install the plugin in your Dify environment
  3. Start adding watermarks to your files immediately

Key Features

  • 100% Local Processing: All watermarking operations are performed entirely on your local machine
  • No External Services Required: No need to connect to any external services or third-party APIs
  • No API Key Needed: Completely free to use without any API key configuration
  • Maximum Data Security: Your files never leave your local environment, ensuring complete privacy and security
  • Zero Network Dependencies: Works offline without requiring internet connection
Chinese English

Core Features

Image Watermarking

  • Add Text Watermark: Add customizable text watermarks to images with position, opacity, color, and font size controls
  • Add Icon Watermark: Add icon or logo watermarks to images with position, opacity, and scale controls
  • Multiple Positions: Center, corners, or tile across the entire image
  • Customizable Opacity: Adjust watermark transparency (0-255)
  • Color Options: Choose from 5 predefined colors (Gray, Red, Green, Blue, Yellow)
  • Font Size Control: Adjust text size to fit your needs
  • Chinese Font Support: Built-in Chinese font to prevent garbled text
  • Flexible Input: Support both file upload and URL input for icon watermarks

Video Watermarking

  • Add Text Watermark: Add customizable text watermarks to videos with position, opacity, color, and font size controls
  • Add Icon Watermark: Add icon or logo watermarks to videos with position, opacity, and scale controls
  • Multiple Positioning Options: Center, corners, or tile across the entire video
  • Opacity Control: Supports 0-1 range opacity adjustment
  • Color Options: Custom color support in hex format
  • Font Size Control: Adjust text size to fit your needs
  • Scale Control: Adjust icon size relative to video dimensions
  • Flexible Input: Support both file upload and URL input for icon watermarks
  • Pure Python Implementation: No external dependencies like ImageMagick required
  • High-Quality Output: Output in MP4 format with H.264 codec and AAC audio

PDF Document Watermarking

  • Add Text Watermark: Add tiled text watermarks to PDF documents with opacity and font size controls
  • Add Icon Watermark: Add icon watermarks to PDF documents with opacity and position controls
  • Multiple Positioning Options: Center, tile, top-left, top-right, bottom-left, bottom-right
  • Opacity Control: Supports 0-1 range opacity adjustment
  • Chinese Support: Uses built-in Chinese font to prevent garbled text
  • Auto-size Font: Supports automatic font size adjustment for text watermarks
  • Full-page Coverage: Applies to all PDF pages

Word Document Watermarking

  • Add Text Watermark: Add text watermarks to Word documents with opacity, font size, position, and alignment controls
  • Add Icon Watermark: Add icon watermarks to Word documents with opacity, position, and alignment controls
  • Multiple Positioning Options: Header, footer, or center
  • Alignment Options: Left, center, or right alignment (for header/footer)
  • Opacity Control: Supports 0-1 range opacity adjustment
  • Behind Text: Watermarks are automatically placed behind text
  • Auto-size Font: Supports automatic font size adjustment for text watermarks
  • Section Support: Supports all sections in the document

PowerPoint Presentation Watermarking

  • Add Text Watermark: Add text watermarks to PowerPoint presentations with opacity, font size, and position controls
  • Add Icon Watermark: Add icon watermarks to PowerPoint presentations with opacity, scale, and position controls
  • Multiple Positioning Options: Tile, center, top-left, top-right, bottom-left, bottom-right
  • Opacity Control: Supports 0-1 range opacity adjustment
  • Rotation Effect: Text watermarks are automatically rotated -30 degrees
  • Auto-size Font: Supports automatic font size adjustment for text watermarks
  • Background Layer: Watermarks are placed in the background layer
  • Master Slide Support: Added to all slide masters for consistency

Excel Workbook Watermarking

  • Add Text Watermark: Add text watermarks to Excel workbooks with opacity, font size, and position controls
  • Add Icon Watermark: Add icon watermarks to Excel workbooks with opacity and position controls
  • Watermark Position Control: Choose to place watermarks on top of data or below data
  • Opacity Control: Supports 0-1 range opacity adjustment
  • Auto-size Font: Supports automatic font size adjustment for text watermarks
  • Floating Elements: Watermarks are inserted as floating elements
  • Data Preservation: Maintains original data integrity
  • All Worksheets: Applies to all worksheets in the workbook

Technical Advantages

  • Local Processing: All watermarking is performed locally without external dependencies
  • High-Quality Output: Maintains original file quality while adding watermarks
  • Flexible Options: Various configuration options for different use cases
  • Error Handling: Robust error handling with informative messages
  • Secure Processing: Files are processed securely without data retention
  • Chinese Font Support: Prevents garbled text for Chinese characters
  • Multiple Positioning: Supports various positioning options for different file types
  • Auto-size Adjustment: Automatic font and icon size adjustment for optimal results

Requirements

  • Python 3.12
  • Dify Platform access
  • Required Python packages (installed via requirements.txt)

Installation & Configuration

  1. Install the required dependencies:

    pip install -r requirements.txt
  2. Install the plugin in your Dify environment following the standard plugin installation process

Usage

The plugin provides the following tools for file watermarking:

Image Watermarking Tools

1. Add Text Watermark (img_add_text_watermark)

Add customizable text watermarks to images with position, opacity, color, and font size controls.

  • Parameters:
    • image_file: The original image file to add watermark (required)
    • text: The text content of the watermark (required)
    • position: The position of the watermark (optional, default: tile)
      • center: Center of the image
      • corners: All four corners
      • br: Bottom right
      • bl: Bottom left
      • tr: Top right
      • tl: Top left
      • tile: Tile across the entire image (default)
    • opacity: The opacity of the watermark (optional, default: 40, range: 0-255)
    • color: The color of the watermark (optional, default: #808080)
      • Gray: #808080
      • Red: #FF0000
      • Green: #00FF00
      • Blue: #0000FF
      • Yellow: #FFFF00
    • font_size: The font size of the watermark (optional, default: 30, range: 1+)
  • Features:
    • Supports Chinese text with built-in font
    • Tile mode with rotation for full-screen watermarking
    • Multiple positioning options for flexibility
    • Adjustable transparency and color

2. Add Icon Watermark (img_add_icon_watermark)

Add icon or logo watermarks to images with position, opacity, and scale controls.

  • Parameters:
    • image_file: The base image file to add watermark (required)
    • icon_file: The logo image file for watermark (optional, recommended: png or jpg)
    • icon_url: The URL of logo image for watermark (optional)
    • scale: The scale of the logo as percentage of base image width (optional, default: 10, range: 1-100)
    • position: The position of the watermark (optional, default: bottom_right)
      • center: Center of the image
      • top_left: Top left corner
      • bottom_right: Bottom right corner (default)
    • opacity: The opacity of the watermark (optional, default: 100, range: 0-255)
  • Features:
    • Supports both file upload and URL input
    • Flexible scaling based on image width
    • Multiple positioning options
    • Preserves icon transparency

Video Watermarking Tools

3. Add Text Watermark to Video (video_add_text_watermark)

Add customizable text watermarks to videos with position, opacity, color, and font size controls.

  • Parameters:
    • video_file: The video file to add watermark (required)
    • text: The text content of the watermark (required)
    • position: The position of the watermark (optional, default: bottom_right)
      • center: Center of the video
      • top_left: Top left corner
      • top_right: Top right corner
      • bottom_left: Bottom left corner
      • bottom_right: Bottom right corner (default)
    • opacity: The opacity of the watermark (optional, default: 0.5, range: 0-1)
    • color: The color of the watermark in hex format (optional, default: #FFFFFF)
    • font_size: The font size of the watermark (optional, default: 40, range: 1+)
  • Features:
    • Pure Python implementation using PIL, no ImageMagick required
    • Supports Chinese text with built-in font
    • Multiple positioning options with relative margins (5% of video dimensions)
    • Adjustable transparency and color
    • High-quality MP4 output with H.264 codec and AAC audio
    • Automatic watermark sizing (10% of video height)

4. Add Icon Watermark to Video (video_add_icon_watermark)

Add icon or logo watermarks to videos with position, opacity, and scale controls.

  • Parameters:
    • video_file: The video file to add watermark (required)
    • icon_file: The logo image file for watermark (optional, recommended: PNG format)
    • icon_url: The URL of the logo image for watermark (optional)
    • scale: The scale of the logo as percentage of video height (optional, default: 15, range: 1-100)
    • position: The position of the watermark (optional, default: bottom_right)
      • center: Center of the video
      • top_left: Top left corner
      • top_right: Top right corner
      • bottom_left: Bottom left corner
      • bottom_right: Bottom right corner (default)
    • opacity: The opacity of the watermark (optional, default: 0.8, range: 0-1)
  • Features:
    • Supports both file upload and URL input
    • Flexible scaling based on video height
    • Multiple positioning options with relative margins (3% of video dimensions)
    • Preserves icon transparency
    • High-quality MP4 output with H.264 codec and AAC audio
    • Automatic icon resizing and conversion to NumPy array

PDF Document Watermarking Tools

5. Add Text Watermark to PDF (pdf_add_text_watermark)

Add tiled text watermarks to PDF documents with opacity and font size controls.

  • Parameters:
    • doc_file: The PDF file to add watermark (required)
    • text_content: The text content of the watermark, max 100 characters (required)
    • opacity: The opacity of the watermark (optional, default: 0.1, range: 0-1)
    • font_size: The font size of the watermark (optional, default: 20, 0 for auto-size)
  • Features:
    • Full-screen tiling with -30 degree rotation
    • Supports Chinese text with built-in font
    • Applies to all PDF pages
    • Auto-size font adjustment

6. Add Icon Watermark to PDF (pdf_add_icon_watermark)

Add icon watermarks to PDF documents with opacity and position controls.

  • Parameters:
    • doc_file: The PDF file to add watermark (required)
    • icon_file: The logo image file for watermark (optional, recommended: PNG format)
    • icon_url: The URL of the logo image for watermark (optional)
    • opacity: The opacity of the watermark (optional, default: 0.1, range: 0-1)
    • position: The position of the watermark (optional, default: top-right)
      • center: Center of the page
      • tile: Tile across the page
      • top-left: Top left corner
      • top-right: Top right corner (default)
      • bottom-left: Bottom left corner
      • bottom-right: Bottom right corner
  • Features:
    • Multiple positioning options
    • Automatic icon size adjustment
    • Applies to all PDF pages
    • Preserves icon transparency

Word Document Watermarking Tools

7. Add Text Watermark to Word (word_add_text_watermark)

Add text watermarks to Word documents with opacity, font size, position, and alignment controls.

  • Parameters:
    • doc_file: The Word file to add watermark (required)
    • text_content: The text content of the watermark, max 100 characters (required)
    • opacity: The opacity of the watermark (optional, default: 0.5, range: 0-1)
    • font_size: The font size of the watermark (optional, default: 20, 0 for auto-size)
    • position: The position of the watermark (optional, default: Header)
      • center: Center of the page
      • header: Header (default)
      • footer: Footer
    • alignment: The alignment of the watermark (optional, default: right)
      • left: Left alignment
      • center: Center alignment
      • right: Right alignment (default)
  • Features:
    • Text converted to image and inserted in header/footer or center
    • Automatically placed behind text
    • Supports all sections
    • Auto-size font adjustment

8. Add Icon Watermark to Word (word_add_icon_watermark)

Add icon watermarks to Word documents with opacity, position, and alignment controls.

  • Parameters:
    • doc_file: The Word file to add watermark (required)
    • icon_file: The logo image file for watermark (optional, recommended: PNG format)
    • icon_url: The URL of the logo image for watermark (optional)
    • opacity: The opacity of the watermark (optional, default: 0.5, range: 0-1)
    • position: The position of the watermark (optional, default: center)
      • center: Center of the page (default)
      • header: Header
      • footer: Footer
    • alignment: The alignment of the watermark (optional, default: right)
      • left: Left alignment
      • center: Center alignment
      • right: Right alignment (default)
  • Features:
    • Icon inserted in header/footer or center
    • Automatically placed behind text
    • Supports all sections
    • Preserves icon transparency

PowerPoint Presentation Watermarking Tools

9. Add Text Watermark to PowerPoint (ppt_add_text_watermark)

Add text watermarks to PowerPoint presentations with opacity, font size, and position controls.

  • Parameters:
    • doc_file: The PowerPoint file to add watermark (required)
    • text_content: The text content of the watermark, max 100 characters (required)
    • opacity: The opacity of the watermark (optional, default: 0.3, range: 0-1)
    • font_size: The font size of the watermark (optional, default: 36, 0 for auto-size)
    • position: The position of the watermark (optional, default: tile)
      • tile: Tile across the slide (default)
      • center: Center of the slide
      • top-left: Top left corner
      • top-right: Top right corner
      • bottom-left: Bottom left corner
      • bottom-right: Bottom right corner
  • Features:
    • Added to all slide masters
    • Automatically rotated -30 degrees
    • Placed in background layer
    • Multiple positioning options
    • Auto-size font adjustment

10. Add Icon Watermark to PowerPoint (ppt_add_icon_watermark)

Add icon watermarks to PowerPoint presentations with opacity, scale, and position controls.

  • Parameters:
    • doc_file: The PowerPoint file to add watermark (required)
    • icon_file: The logo image file for watermark (optional, recommended: PNG format)
    • icon_url: The URL of the logo image for watermark (optional)
    • opacity: The opacity of the watermark (optional, default: 0.1, range: 0-1)
    • scale: The scaling factor for the icon size (optional, default: 0.6, range: 0.1+)
    • position: The position of the watermark (optional, default: top-right)
      • center: Center of the slide
      • top-left: Top left corner
      • top-right: Top right corner (default)
      • bottom-left: Bottom left corner
      • bottom-right: Bottom right corner
  • Features:
    • Added to all slide masters
    • Multiple positioning options
    • Flexible icon scaling
    • Placed in background layer
    • Preserves icon transparency

Excel Workbook Watermarking Tools

11. Add Text Watermark to Excel (excel_add_text_watermark)

Add text watermarks to Excel workbooks with opacity, font size, and position controls.

  • Parameters:
    • doc_file: The Excel file to add watermark (required)
    • text_content: The text content of the watermark, max 100 characters (required)
    • opacity: The opacity of the watermark (optional, default: 0.1, range: 0-1)
    • font_size: The font size of the watermark (optional, default: 40, 0 for auto-size)
    • watermark_position: Position of the watermark relative to data (optional, default: on_data)
      • on_data: Watermark placed on top of data (default)
      • below_data: Watermark placed below data
  • Features:
    • Text converted to image
    • Inserted into all worksheets
    • Floating element placement
    • Adjustable watermark position
    • Auto-size font adjustment
    • Preserves original data

12. Add Icon Watermark to Excel (excel_add_icon_watermark)

Add icon watermarks to Excel workbooks with opacity and position controls.

  • Parameters:
    • doc_file: The Excel file to add watermark (required)
    • icon_file: The logo image file for watermark (optional, recommended: PNG format)
    • icon_url: The URL of the logo image for watermark (optional)
    • opacity: The opacity of the watermark (optional, default: 0.1, range: 0-1)
    • watermark_position: Position of the watermark relative to data (optional, default: on_data)
      • on_data: Watermark placed on top of data (default)
      • below_data: Watermark placed below data
  • Features:
    • Inserted into all worksheets
    • Floating element placement
    • Adjustable watermark position
    • Preserves icon transparency
    • Maintains original data integrity

Notes

  • All watermarking is performed locally without uploading files to external services
  • The plugin includes a Chinese font to prevent garbled text
  • For text watermarking, the tile mode rotates text at -30 degrees for better coverage
  • For icon watermarking, either icon_file or icon_url must be provided
  • Large files may take longer to process depending on their size and complexity
  • The quality of output files depends on the quality of the input files
  • Font size can be set to 0 for automatic adjustment (where supported)
  • Position and alignment options vary by file type for optimal results

Developer Information

  • Author: https://github.com/sawyer-shi
  • Email: [email protected]
  • License: Apache License 2.0
  • Source Code: https://github.com/sawyer-shi/dify-plugins-file_watermark
  • Support: Through Dify platform and GitHub Issues

License Notice

This project is licensed under the Apache License 2.0. See the LICENSE file for the full license text.


Ready to protect your files with watermarks?

Plugin Submission Form

1. Metadata

  • Plugin Author:
  • Plugin Name:
  • Repository URL:

2. Submission Type

  • New plugin submission
  • Version update for existing plugin

3. Description

4. Checklist

  • I have read and followed the Publish to Dify Marketplace guidelines
  • I have read and comply with the Plugin Developer Agreement
  • I confirm my plugin works properly on both Dify Community Edition and Cloud Version
  • I confirm my plugin has been thoroughly tested for completeness and functionality
  • My plugin brings new value to Dify

5. Documentation Checklist

Please confirm that your plugin README includes all necessary information:

  • Step-by-step setup instructions
  • Detailed usage instructions
  • All required APIs and credentials are clearly listed
  • Connection requirements and configuration details
  • Link to the repository for the plugin source code

6. Privacy Protection Information

Based on Dify Plugin Privacy Protection Guidelines:

Data Collection

Privacy Policy

  • I confirm that I have prepared and included a privacy policy in my plugin package based on the Plugin Privacy Protection Guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant