banana-watermark-remover
v1.0.0
Published
CLI tool to remove star-shaped AI watermarks from images
Maintainers
Readme
Banana Watermark Remover
A CLI tool to remove star-shaped AI watermarks from images using alpha unmixing.
How It Works
Some AI image generators add a semi-transparent star-shaped watermark to the bottom-right corner of generated images. This tool uses alpha unmixing to mathematically reverse the alpha compositing and recover the original pixels underneath.
The algorithm:
- Detects watermark size based on image dimensions (48px or 96px)
- Locates the watermark position (bottom-right corner)
- Applies the inverse alpha blending formula:
original = (watermarked - 255*alpha) / (1 - alpha)
Note: This only removes visible watermarks. It cannot remove invisible watermarks embedded in pixel data.
Installation
npm install -g banana-watermark-removerOr use directly with npx:
npx banana-watermark-remover input.png output.pngUsage
# Basic usage - specify input and output
banana-watermark-remover input.png output.png
# Auto-naming - creates input_clean.png
banana-watermark-remover input.png
# Supports different formats
banana-watermark-remover input.png output.jpg
banana-watermark-remover input.webp output.webp
# Batch mode - process multiple files using glob patterns
banana-watermark-remover "images/*.png"
banana-watermark-remover "**/*.jpg"Note: When using glob patterns, output paths are auto-generated (e.g., image.png becomes image_clean.png). You cannot specify a custom output path in batch mode.
Supported Formats
- PNG (recommended)
- JPEG
- WebP
Requirements
- Node.js 22+
- Images must have a compatible star-shaped watermark in the bottom-right corner
Watermark Detection
The tool automatically selects the correct watermark configuration:
| Image Size | Logo Size | Margin | |------------|-----------|--------| | <=1024px (either dimension) | 48x48px | 32px | | >1024px (both dimensions) | 96x96px | 64px |
Local Development
# Clone the repository
git clone https://github.com/jantimon/banana-watermark-remover.git
cd banana-watermark-remover
# Install dependencies
npm install
# Build
npm run build
# Run locally
node dist/index.js input.png output.pngLicense
MIT License - see LICENSE for details.
Disclaimer
This tool is provided for educational and personal use. Users are responsible for ensuring their use complies with applicable terms of service and local regulations.
