[PR #1925] [MERGED] New: add a new plugin file_watermark-0.0.1.difypkg【Local File Watermarking Tool: Supports adding secure watermarks to images, videos, PDF, DOCX, PPTX, XLSX files (including text watermarks and logo watermarks).】 #1960

Closed
opened 2026-02-22 18:12:53 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugins/pull/1925
Author: @sawyer-shi
Created: 1/20/2026
Status: Merged
Merged: 1/22/2026
Merged by: @crazywoola

Base: mainHead: main-file_watermark-0.0.1.difypkg


📝 Commits (4)

  • ea18990 update: for plugin file_encrypt_decrypt-0.0.2.difypkg【update the description】
  • a30eaed update: for plugin file_encrypt_decrypt-0.0.2.difypkg【update the description】
  • 2c083d7 update: for plugin file_encrypt_decrypt-0.0.2.difypkg【update the description】
  • 60a0476 New: add a new plugin file_watermark-0.0.1.difypkg【Local File Watermarking Tool: Supports adding secure watermarks to images, videos, PDF, DOCX, PPTX, XLSX files (including text watermarks and logo watermarks).】

📊 Changes

1 file changed (+0 additions, -0 deletions)

View changed files

sawyer-shi/file_watermark/file_watermark-0.0.1.difypkg (+0 -0)

📄 Description

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: sawyer36@foxmail.com
  • 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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-plugins/pull/1925 **Author:** [@sawyer-shi](https://github.com/sawyer-shi) **Created:** 1/20/2026 **Status:** ✅ Merged **Merged:** 1/22/2026 **Merged by:** [@crazywoola](https://github.com/crazywoola) **Base:** `main` ← **Head:** `main-file_watermark-0.0.1.difypkg` --- ### 📝 Commits (4) - [`ea18990`](https://github.com/langgenius/dify-plugins/commit/ea1899093c68d19f932039cbf39c8a5e0b03f089) update: for plugin file_encrypt_decrypt-0.0.2.difypkg【update the description】 - [`a30eaed`](https://github.com/langgenius/dify-plugins/commit/a30eaed6edf96203c1d8a4aab2b844fc873fdbd1) update: for plugin file_encrypt_decrypt-0.0.2.difypkg【update the description】 - [`2c083d7`](https://github.com/langgenius/dify-plugins/commit/2c083d700921cb89645dc7667cc8e0f6bccc6394) update: for plugin file_encrypt_decrypt-0.0.2.difypkg【update the description】 - [`60a0476`](https://github.com/langgenius/dify-plugins/commit/60a0476cbc775b9114f24906f771acc52712f0e8) New: add a new plugin file_watermark-0.0.1.difypkg【Local File Watermarking Tool: Supports adding secure watermarks to images, videos, PDF, DOCX, PPTX, XLSX files (including text watermarks and logo watermarks).】 ### 📊 Changes **1 file changed** (+0 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `sawyer-shi/file_watermark/file_watermark-0.0.1.difypkg` (+0 -0) </details> ### 📄 Description # 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 <img width="378" height="1025" alt="Chinese" src="https://github.com/user-attachments/assets/40cb192a-0036-476f-9b44-bbe1ae68f709" /> <img width="369" height="1105" alt="English" src="https://github.com/user-attachments/assets/b8f4a51d-7ca5-4c1e-aca7-ec141b5fb149" /> ## 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: ```bash 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**: sawyer36@foxmail.com - **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](LICENSE) file for the full license text. --- **Ready to protect your files with watermarks?** # Plugin Submission Form ## 1. Metadata <!-- Please provide the following metadata of your plugin to make it easier for the reviewer to check the changes. - Plugin Author : The author of the plugin which is defined in your manifest.yaml - Plugin Name : The name of the plugin which is defined in your manifest.yaml - Repository URL: The URL of the repository where the source code of your plugin is hosted --> - **Plugin Author**: - **Plugin Name**: - **Repository URL**: ## 2. Submission Type - [x] New plugin submission - [ ] Version update for existing plugin ## 3. Description <!-- Please briefly describe the purpose of the new plugin or the updates made to the existing plugin --> ## 4. Checklist - [x] I have read and followed the Publish to Dify Marketplace guidelines - [x] I have read and comply with the Plugin Developer Agreement - [x] I confirm my plugin works properly on both Dify Community Edition and Cloud Version - [x] I confirm my plugin has been thoroughly tested for completeness and functionality - [x] My plugin brings new value to Dify ## 5. Documentation Checklist Please confirm that your plugin README includes all necessary information: - [x] Step-by-step setup instructions - [x] Detailed usage instructions - [x] All required APIs and credentials are clearly listed - [x] Connection requirements and configuration details - [x] Link to the repository for the plugin source code ## 6. Privacy Protection Information Based on Dify Plugin Privacy Protection [Guidelines](https://docs.dify.ai/plugins/publish-plugins/publish-to-dify-marketplace/plugin-privacy-protection-guidelines): ### Data Collection <!-- Does your plugin collect any user personal data? If yes, please list what types of user personal data are being collected according to the Plugin Privacy Protection Guidelines (for example: Email address, IP address, Age, etc) --> ### Privacy Policy - [x] I confirm that I have prepared and included a privacy policy in my plugin package based on the Plugin Privacy Protection Guidelines --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:12:53 -05:00
yindo closed this issue 2026-02-22 18:12:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugins#1960