Gemini Watermark Remover
Remove visible Gemini AI watermarks (star/sparkle logo) from generated images using mathematically accurate reverse alpha blending.
Fully offline — pure Python, local processing only, images are not uploaded.
When to Use
- - Remove watermark from Gemini AI generated images
- Clean images before publishing or sharing
- Batch process multiple images
Quick Start
Install Dependencies (one-time)
CODEBLOCK0
Usage
CODEBLOCK1
How It Works
Gemini adds watermark using alpha blending:
CODEBLOCK2
Reverse the equation:
CODEBLOCK3
Detection Rules
| Image Size | Watermark Size | Right Margin | Bottom Margin |
|---|
| Width > 1024 AND Height > 1024 | 96×96 | 64px | 64px |
| Otherwise |
48×48 | 32px | 32px |
Key Points
- - Uses built-in watermark templates (
assets/bg_48.png / assets/bg_96.png) - Alpha map = max RGB channel value (not alpha channel)
- Includes noise filtering (ALPHANOISEFLOOR)
- Pure mathematical method, pixel-level accuracy
Limitations
- - Removes only visible watermark (bottom-right semi-transparent logo)
- Cannot remove invisible watermarks (e.g., SynthID)
- Designed for current Gemini watermark pattern
Dependencies
- - Python 3
- Pillow (PIL)
- NumPy
Gemini 水印移除工具
从Gemini AI生成的图像中移除可见水印(星形/闪光标志),使用数学精确的反向Alpha混合算法。
完全离线运行 — 纯Python实现,仅本地处理,图像不会被上传。
适用场景
- - 移除Gemini AI生成图像中的水印
- 在发布或分享前清理图像
- 批量处理多张图像
快速开始
安装依赖(一次性)
bash
pip install Pillow numpy
使用方法
bash
单张图像(自动检测水印)
python3 scripts/remove_watermark.py photo.jpg
指定输出路径
python3 scripts/remove
watermark.py photo.jpg -o cleanphoto.jpg
强制移除,不进行检测
python3 scripts/remove_watermark.py photo.jpg -o clean.jpg --force
工作原理
Gemini使用Alpha混合添加水印:
水印图像 = alpha 255 + (1 - alpha) 原始图像
反向推导公式:
原始图像 = (水印图像 - alpha * 255) / (1 - alpha)
检测规则
| 图像尺寸 | 水印尺寸 | 右侧边距 | 底部边距 |
|---|
| 宽度 > 1024 且 高度 > 1024 | 96×96 | 64px | 64px |
| 其他情况 |
48×48 | 32px | 32px |
关键要点
- - 使用内置水印模板(assets/bg48.png / assets/bg96.png)
- Alpha映射 = RGB通道最大值(非Alpha通道)
- 包含噪声过滤(ALPHANOISEFLOOR)
- 纯数学方法,像素级精度
局限性
- - 仅移除可见水印(右下角半透明标志)
- 无法移除不可见水印(如SynthID)
- 专为当前Gemini水印模式设计
依赖项
- - Python 3
- Pillow(PIL)
- NumPy