ai-watermark-remover
v1.0.0
Published
Remove AI watermarks (Gemini, etc.) from images
Maintainers
Readme
ai-watermark-remover
Remove AI-generated watermarks from images. Currently supports Google Gemini (Nano Banana) watermarks.
How it works
Gemini adds watermarks using alpha blending: watermarked = α × logo + (1 - α) × original
This tool reverses the process: original = (watermarked - α × logo) / (1 - α)
The alpha map is extracted from known watermark patterns (48×48 for images ≤1024px, 96×96 for larger).
Installation
# Global install from npm
npm i -g ai-watermark-remover
# Or run directly without installing
npx ai-watermark-remover image.jpgUsage
CLI
# Process single file (overwrites original)
ai-watermark-remover image.jpg
# Save to different file
ai-watermark-remover image.jpg cleaned.jpg
# Process entire directory
ai-watermark-remover ./images/
# Force watermark size detection
ai-watermark-remover image.jpg -s small # 48×48
ai-watermark-remover image.jpg -s large # 96×96As a library
import { removeWatermark, removeWatermarkFromFile } from 'ai-watermark-remover';
// From file to file
await removeWatermarkFromFile('input.jpg', 'output.jpg');
// From buffer (useful for APIs/servers)
const cleanedBuffer = await removeWatermark(imageBuffer);Supported formats
- JPEG (.jpg, .jpeg)
- PNG (.png)
- WebP (.webp)
- BMP (.bmp)
Limitations
- Only works with Gemini watermarks (other AI tools use different patterns)
- Best results with lossless formats (PNG, WebP lossless)
- JPEG compression may reduce quality of removal
- Won't work if image was cropped/rotated after watermark was added
Credits
Algorithm based on GeminiWatermarkTool by AllenK.
License
MIT
