Image Toolbox
A powerful Dify plugin providing comprehensive local image processing capabilities. All image operations are executed entirely on your local machine without any external services, API keys, or internet connections, ensuring maximum data security and privacy. Supports adding watermarks (text and icon), resizing images (crop and pad), and converting between multiple image formats (JPG, PNG, WEBP, BMP, TIFF, GIF, ICO, SVG).
Version Information
- Current Version: v0.0.1
- Release Date: 2026-01-02
- Compatibility: Dify Plugin Framework
- Python Version: 3.12
Version History
- v0.0.1 (2026-01-02): Initial version with watermark, resize, and format conversion features
Quick Start
- Download the image_toolbox plugin from Dify marketplace
- Install the plugin in your Dify environment
- Start processing your images immediately
Core Features
- 100% Local Processing: All image operations are executed entirely on your local machine
- No External Services: No need to connect to any external services or third-party APIs
- No API Keys Required: Completely free to use without any API key configuration
- Maximum Data Security: Your images never leave your local environment, ensuring complete privacy and security
- Zero Network Dependency: Works offline without internet connection
Core Functions
1. Image Watermarking
Text Watermark
- Add Text Watermark: Add customizable text watermarks to images
- Multiple Positions: Center, corners, or full-screen tiling
- Custom 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 meet your needs
- Chinese Font Support: Built-in Chinese font to prevent character encoding issues
Icon Watermark
- Add Icon Watermark: Add icon or logo watermarks to images
- Multiple Input Methods: Upload icon file or provide icon URL
- Flexible Positioning: Center, top-left, or bottom-right placement
- Scale Control: Adjust icon size as a percentage of base image width (1-100%)
- Opacity Adjustment: Fine-tune watermark transparency (0-255)
2. Image Resizing
Image Resize Crop (object-fit: cover)
- Crop Strategy: Resize image using crop strategy (similar to object-fit: cover)
- Fill Target Dimensions: Image will fill the target dimensions, excess will be cropped
- Preset Sizes: Standard photo sizes based on 300 DPI (1 inch, large 1 inch, 2 inch, small 2 inch)
- Custom Dimensions: Specify custom width and height in pixels
- High Quality: Uses LANCZOS resampling for best quality
Image Resize Pad (object-fit: contain)
- Pad Strategy: Resize image using pad strategy (similar to object-fit: contain)
- Preserve Original: Original image will be fully displayed
- Background Color: Fill excess area with customizable background color
- Preset Sizes: Standard photo sizes based on 300 DPI (1 inch, large 1 inch, 2 inch, small 2 inch)
- Custom Dimensions: Specify custom width and height in pixels
- High Quality: Uses LANCZOS resampling for best quality
3. Image Compression
Compress images to reduce file size while maintaining acceptable quality.
- Quality Control: Adjust compression quality (1-100)
- Format-Specific Strategies:
- JPG/JPEG/WEBP: Lossy compression with quality parameter
- PNG: Lossless optimization (quality >= 90) or palette quantization (quality < 90)
- SVG/GIF/ICO: Skip compression with notification
- Size Reduction: Reduce file size while maintaining acceptable quality
4. Image Format Conversion
Supports conversion between multiple image formats:
- PNG: Convert to PNG format, preserves transparency
- JPG/JPEG: Convert to JPG/JPEG format, transparency handled by compositing over white background
- WEBP: Convert to WEBP format, preserves transparency
- BMP: Convert to BMP format
- TIFF: Convert to TIFF format
- GIF: Convert to GIF format
- ICO: Convert to ICO format
- SVG: Convert to SVG format
Technical Advantages
- Local Processing: All image processing is executed locally without external dependencies
- High Quality Output: Maintains original image quality while processing
- Flexible Options: Various configuration options for different use cases
- Error Handling: Robust error handling with informative messages
- Secure Processing: Images are processed securely without data retention
- Chinese Font Support: Prevents Chinese character encoding issues
Requirements
- Python 3.12
- Dify platform access
- Required Python packages (install via requirements.txt)
Installation & Configuration
-
Install required dependencies:
-
Install the plugin in your Dify environment following the standard plugin installation process
Usage
The plugin provides the following tools:
1. Image Compress (image_compress)
Compress images to reduce file size.
- Parameters:
- : The original image file to compress (required)
- : Compression quality (optional, default: 80, range: 1-100)
- Features:
- Format-specific compression strategies
- JPG/JPEG/WEBP: Lossy compression with quality parameter
- PNG: Lossless optimization (quality >= 90) or palette quantization (quality < 90)
- SVG/GIF/ICO: Skip compression with notification
- Displays input/output format and file size
2. Add Text Watermark (add_text_watermark)
Add customizable text watermarks to images.
- Parameters:
- : The original image file to add watermark (required)
- : The text content of the watermark (required)
- : The position of the watermark (optional, default: tile)
- : Image center
- : Four corners
- : Bottom right
- : Bottom left
- : Top right
- : Top left
- : Full-screen tiling (default)
- : The opacity of the watermark (optional, default: 40, range: 0-255)
- : The color of the watermark (optional, default: #808080)
- : #808080
- : #FF0000
- : #00FF00
- : #0000FF
- : #FFFF00
- : The font size of the watermark (optional, default: 30, range: 1+)
- Features:
- Supports Chinese text with built-in Chinese font
- Tiling mode with rotation for full-screen watermark
- Multiple positioning options
- Adjustable opacity and color
3. Add Icon Watermark (add_icon_watermark)
Add icon or logo watermarks to images.
- Parameters:
- : The base image file to add watermark (required)
- : The logo image file for watermark (optional, recommended: png or jpg)
- : The URL of the logo image for watermark (optional)
- : The scale of the logo (percentage of base image width) (optional, default: 20, range: 1-100)
- : The position of the watermark (optional, default: bottom_right)
- : Image center
- : Top left corner
- : Bottom right corner (default)
- : The opacity of the watermark (optional, default: 200, range: 0-255)
- Features:
- Supports both file upload and URL input
- Flexible scaling based on image width
- Multiple positioning options
- Maintains icon transparency
4. Image Resize Crop (image_resize_crop)
Resize image using crop strategy (object-fit: cover).
- Parameters:
- : The original image file to resize (required)
- : Standard photo sizes based on 300 DPI (optional, default: none)
- : No preset
- : 1 inch (25mm x 35mm) - 295x413 pixels
- : Large 1 inch (33mm x 48mm) - 390x567 pixels
- : 2 inch (35mm x 49mm) - 413x579 pixels
- : Small 2 inch (35mm x 45mm) - 413x531 pixels
- : Custom width in pixels (required when preset_size is none)
- : Custom height in pixels (required when preset_size is none)
- Features:
- Image fills target dimensions completely
- Excess areas are cropped
- High-quality LANCZOS resampling
- Standard photo size presets
5. Image Resize Pad (image_resize_pad)
Resize image using pad strategy (object-fit: contain).
- Parameters:
- : The original image file to resize (required)
- : Standard photo sizes based on 300 DPI (optional, default: none)
- : No preset
- : 1 inch (25mm x 35mm) - 295x413 pixels
- : Large 1 inch (33mm x 48mm) - 390x567 pixels
- : 2 inch (35mm x 49mm) - 413x579 pixels
- : Small 2 inch (35mm x 45mm) - 413x531 pixels
- : Custom width in pixels (required when preset_size is none)
- : Custom height in pixels (required when preset_size is none)
- : Background color for padding (optional, default: #FFFFFF)
- Features:
- Original image fully displayed
- Excess areas filled with background color
- High-quality LANCZOS resampling
- Standard photo size presets
- Customizable padding color
6. Convert to JPG (convert_to_jpg)
Convert image to JPG format (.jpg extension).
- Parameters:
- : The original image file to convert (required)
- Features:
- Outputs .jpg extension file
- Transparency handled by compositing over white background
- Displays input/output format and file size
7. Convert to JPEG (convert_to_jpeg)
Convert image to JPEG format (.jpeg extension).
- Parameters:
- : The original image file to convert (required)
- Features:
- Outputs .jpeg extension file
- Transparency handled by compositing over white background
- Displays input/output format and file size
8. Convert to BMP (convert_to_bmp)
Convert image to BMP format.
- Parameters:
- : The original image file to convert (required)
- Features:
- Uncompressed format
- Widely compatible
9. Convert to PNG (convert_to_png)
Convert image to PNG format.
- Parameters:
- : The original image file to convert (required)
- Features:
- Preserves transparency
- Lossless compression
10. Convert to WEBP (convert_to_webp)
Convert image to WEBP format.
- Parameters:
- : The original image file to convert (required)
- Features:
- Preserves transparency
- Modern format with excellent compression
11. Convert to TIFF (convert_to_tiff)
Convert image to TIFF format.
- Parameters:
- : The original image file to convert (required)
- Features:
- Lossless compression
- Professional format
12. Convert to GIF (convert_to_gif)
Convert image to GIF format.
- Parameters:
- : The original image file to convert (required)
- Features:
- Animated support
- Web-friendly format
13. Convert to ICO (convert_to_ico)
Convert image to ICO format.
- Parameters:
- : The original image file to convert (required)
- Features:
- Icon format for Windows
- Multiple sizes support
14. Convert to SVG (convert_to_svg)
Convert image to SVG format.
- Parameters:
- : The original image file to convert (required)
- Features:
- Scalable vector format
- Web-friendly format
Notes
- All image processing is executed locally without uploading images to external services
- The plugin includes Chinese fonts to prevent character encoding issues
- For text watermarks, tiling mode rotates text by -30 degrees for better coverage
- For icon watermarks, either icon_file or icon_url must be provided
- Large images may require longer processing time depending on their size and complexity
- Output image quality depends on the quality of the input image
Developer Information
- Author:
- Email: [email protected]
- License: Apache License 2.0
- Source Code:
- Support: Available through Dify platform and GitHub Issues
License Statement
This project is licensed under the Apache License 2.0. The full license text is available in the LICENSE [blocked] file.
Ready to process your images?