watermark-removal
Universal Watermark Removal
Remove watermarks from ANY image source using intelligent detection and proven methods. Smart routing: automatically detects Google SynthID and uses the proven aggressive method, falls back to ML inpainting for unknown watermark types.
Quick Start
Single Image - Smart Auto-Detection (Recommended)
# Smart detection: Google SynthID → aggressive method (proven), Unknown → inpaint (ML)
python .claude/skills/watermark-removal/scripts/remove-watermark.py \
input.png \
output.png
Single Image - Preserve Dimensions (Force ML)
# Force ML inpainting even for Google SynthID (preserves exact dimensions)
python .claude/skills/watermark-removal/scripts/remove-watermark.py \
input.png \
output.png \
--method inpaint
Batch Processing (Get User Approval First!)
⚠️ IMPORTANT: Always ask user before batch processing, especially with crop/aggressive methods that alter dimensions.
# Recommended: Preserves dimensions
python .claude/skills/watermark-removal/scripts/batch-process.py \
/path/to/input-dir \
/path/to/output-dir \
--method inpaint
# Alternative: Fast but crops 120px (requires user approval)
python .claude/skills/watermark-removal/scripts/batch-process.py \
/path/to/input-dir \
/path/to/output-dir \
--method aggressive
Smart Detection System ⭐ NEW
The skill automatically detects Google SynthID watermarks and routes to the optimal removal method:
Google SynthID Detection
Characteristics analyzed:
- RGBA mode (PNG format with alpha channel)
- Large dimensions (>1500px width and height)
- Typical Google AI aspect ratios (1.83, 1.0, 1.5, 1.78 with 10% tolerance)
- Automatic corner detection for watermark location
Smart routing logic:
-
If Google SynthID detected → Uses
aggressivemethod (proven to work perfectly)- Crops 120px from detected corner
- Removes alpha channel watermarking
- Paints over any remnants
- Works 100% reliably on Google AI images
-
If unknown/other watermark → Uses
inpaintmethod (ML-based)- Preserves exact dimensions
- Uses OpenCV Navier-Stokes algorithm
- Works on any watermark type
Override Default Behavior
# Force ML inpainting even for Google SynthID (preserves dimensions)
python scripts/remove-watermark.py input.png output.png --method inpaint
# Force aggressive method for non-Google watermarks
python scripts/remove-watermark.py input.png output.png --method aggressive
# Disable auto-detection (assume bottom-right corner)
python scripts/remove-watermark.py input.png output.png --no-detect
Methods
Inpaint Method (Best Quality) ⭐ NEW
What it does: ML-based inpainting with automatic watermark detection
Features:
- Automatically detects watermark location (any corner)
- Uses OpenCV's Navier-Stokes inpainting algorithm
- Intelligently fills watermark area with surrounding patterns
- Works on ANY watermark type (not just Google SynthID)
Pros:
- Highest quality results
- Preserves exact dimensions
- Works on watermarks in any corner
- Handles complex backgrounds intelligently
- Universal - works on all watermark types
Cons:
- Requires OpenCV installation (
pip install opencv-python) - Slightly slower than crop method
- May need parameter tuning for very large watermarks
Use when:
- You need the best possible quality
- Watermark is on complex/detailed background
- Preserving exact dimensions is critical
- Working with non-Google watermarks
Aggressive Method (Fast & Reliable)
What it does: Auto-detects corner, crops 120px, removes alpha channel, paints remnants
Pros:
- Fast and reliable
- Automatic detection of watermark corner
- Handles RGBA images properly
- Good for batch processing
Cons:
- Reduces image size by 120px
- May crop content near edges
Use when:
- Processing many images quickly (default for batch)
- Size reduction is acceptable
- Google SynthID watermarks
Crop Method
What it does: Auto-detects and crops watermark corner
Pros:
- Fastest method
- Automatic detection
- Minimal processing
Cons:
- May leave watermark remnants
- Doesn't handle alpha channel watermarking
Use when:
- Speed is top priority
- Quick preview needed
Paint Method
What it does: Paints over watermark without cropping (no auto-detection)
Pros:
- Preserves dimensions
- Simple approach
Cons:
- Assumes bottom-right corner only
- May leave visible artifacts
- Less reliable than inpaint
Use when:
- Simple watermarks on solid backgrounds
- Legacy compatibility
Important Guidelines
Dimension Preservation Priority
BALANCE DOMAIN KNOWLEDGE WITH DIMENSION PRESERVATION
-
Smart default behavior:
- Google SynthID detected →
aggressivemethod (proven perfect, crops 120px) - Unknown watermark →
inpaintmethod (preserves dimensions)
- Google SynthID detected →
-
User override available:
- Force dimension preservation with
--method inpaintflag - Force cropping with
--method aggressiveflag
- Force dimension preservation with
-
User approval required for batch cropping:
- If processing multiple Google SynthID images with aggressive method
- Explain that method will reduce image size by 120px
- Get explicit confirmation
- Show before/after dimensions
Batch Processing Protocol
NEVER start batch processing without user confirmation:
-
Show what will happen:
- Number of images to process
- Method to be used
- Whether dimensions will be preserved or altered
-
Get explicit approval:
- "I will process X images using [method]. This [will/will not] alter dimensions. Proceed?"
-
Prefer non-destructive:
- Default to
inpaintfor batch processing - Only use
aggressiveif user specifically requests speed over quality
- Default to
Workflow
1. Identify Watermarked Images
Common watermark types:
- Google SynthID: Small star/sparkle icon in corner
- Stock photos: Logo or text overlay
- AI services: Corner badges (Midjourney, DALL-E)
- Camera watermarks: Date/time stamps
2. Choose Method
Smart Default Workflow (NEW):
- Run script without --method flag - Smart detection automatically routes to best method
- Google SynthID detected → Uses
aggressivemethod (proven perfect) - Unknown watermark → Uses
inpaintmethod (ML-based, preserves dimensions) - Override with --method flag if needed
Method Selection Guide:
- Smart auto (recommended): No flag (detects Google SynthID → aggressive, else → inpaint)
- Force dimension preservation:
--method inpaint(ML-based, works on any watermark) - Force Google method:
--method aggressive(crops 120px, perfect for SynthID) - Maximum speed:
--method crop(fastest, crops but may leave remnants) - Legacy:
--method paint(basic, preserves dimensions but less reliable)
3. Process Images
Smart auto-detection (recommended):
python scripts/remove-watermark.py input.png output.png
Force dimension preservation:
python scripts/remove-watermark.py input.png output.png --method inpaint
Fast batch processing:
python scripts/batch-process.py ./input ./output --method aggressive
Disable auto-detection (force bottom-right):
python scripts/remove-watermark.py input.png output.png --method inpaint --no-detect
4. Verify Results
- Check output images for clean corners
- Verify no important content was cropped
- Confirm watermark fully removed
Command Reference
remove-watermark.py
python scripts/remove-watermark.py INPUT OUTPUT [OPTIONS]
Arguments:
INPUT Input image path
OUTPUT Output image path
Options:
--method {crop|inpaint} Removal method (default: crop)
--size INT Watermark size in pixels (default: 60)
batch-process.py
python scripts/batch-process.py INPUT_DIR OUTPUT_DIR [OPTIONS]
Arguments:
INPUT_DIR Directory with images to process
OUTPUT_DIR Directory for cleaned images
Options:
--method {crop|inpaint} Removal method (default: crop)
--pattern PATTERN File pattern to match (default: *.png)
--size INT Watermark size in pixels (default: 60)
Examples
Example 1: Website Images
Scenario: User has 3 Google AI images for website, watermarks need removal
# Batch process all PNG images
python scripts/batch-process.py \
./public/images \
./public/images-clean \
--method crop \
--pattern "*.png"
Output:
Found 3 images to process
Input: ./public/images
Output: ./public/images-clean
Method: crop
[1/3] Processing: ad-design-bedroom.png
✅ Saved to: ad-design-bedroom.png
[2/3] Processing: ad-design-kitchen.png
✅ Saved to: ad-design-kitchen.png
[3/3] Processing: ad-designs-bathroom.png
✅ Saved to: ad-designs-bathroom.png
✅ Successfully processed: 3/3
Example 2: Preserve Exact Dimensions
Scenario: Client needs exact 1920x1080 image, can't crop
python scripts/remove-watermark.py \
hero-image.png \
hero-image-clean.png \
--method inpaint
Example 3: Larger Watermark
Scenario: Watermark is bigger than usual (70px)
python scripts/batch-process.py \
./images \
./images-clean \
--method crop \
--size 70
Technical Details
See references/synthid-watermark.md for:
- SynthID watermark specifications
- Method comparison details
- Edge cases and considerations
- Legal/ethical guidelines
Dependencies
Required:
- Python 3.7+
- Pillow (PIL):
pip install Pillow - NumPy:
pip install numpy
Optional (for ML inpainting):
- OpenCV:
pip install opencv-python
Install all dependencies:
pip install Pillow numpy opencv-python
Note: The inpaint method requires OpenCV. Other methods work without it.
Tips
Performance:
- Crop method is 5-10x faster than inpaint
- For 100+ images, use crop method
Quality:
- Save with quality=95 to minimize compression
- PNG format preserves quality better than JPEG
Backup:
- Always keep original watermarked images
- Process copies, not originals
Testing:
- Test on one image before batch processing
- Verify watermark size with
--sizeflag if needed
More from horace4444/extend-my-claude-code
image-converter
Convert, resize, compress, and optimize images across formats (HEIC, PNG, JPEG, WebP, AVIF, GIF, TIFF, BMP). Use when working with image files for format conversion, resizing/downscaling, compression/optimization, batch processing, watermarking, metadata stripping, or any image manipulation task. Triggers on requests involving image files, photo processing, or web image optimization.
8ai-api-integrations
Connect applications, scripts, and backend services to AI model APIs (OpenAI, Anthropic Claude, Google Gemini/Vertex AI, xAI Grok), Supabase (PostgreSQL database with vector search), and Clerk (authentication). Use when building AI-powered features that require (1) AI model integration for text generation, translation, embeddings, or image generation, (2) Supabase database operations with pgvector semantic search, (3) Clerk user authentication and session management, (4) Combining AI outputs with database storage, (5) Cost-optimized model selection and prompt engineering, (6) Best practices for production deployments avoiding common anti-patterns.
7skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
4web-design-guidelines
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
4google-image-creator
Generate images using Google AI models (Imagen 4 and Gemini). Presents top 3 model options with pricing, generates images via API, tracks token usage and costs. Use when user needs to: (1) Generate images with Google AI, (2) Choose between Google image models, (3) See pricing for Google image generation, (4) Track image generation costs, or (5) Compare Imagen vs Gemini image models. Self-updating with current pricing from https://ai.google.dev/pricing
4vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
4