Remove watermarks from images generated by Google Gemini AI. Runs entirely locally, with no need to upload images to any server.
How to Use
Method 1: npx (recommended)
# 直接執行,無需安裝
npx gemini-watermark-remove <圖片路徑>
# 範例
npx gemini-watermark-remove image.png
npx gemini-watermark-remove image.png --output clean.png
npx gemini-watermark-remove image.png --mode large --gain 1.5
Method 2: Node.js (use when npx fails)
If npx fails to run, you can use Node.js to run the script directly:
# 1. 先安裝相依套件
cd <skill目錄>
npm install
# 2. 執行腳本
node scripts/remove-watermark.js <圖片路徑>
# 範例
node scripts/remove-watermark.js image.png
node scripts/remove-watermark.js image.png --output clean.png
node scripts/remove-watermark.js image.png --mode large --gain 1.5
Parameters
| Parameter | Description | Default Value |
|---|---|---|
-o, --output |
Output file path | {檔名}_clean.{副檔名} |
-m, --mode |
Mask mode:auto, small, large |
auto |
-g, --gain |
Alpha gain value (1.0-3.0) | 1.0 |
Batch Processing
Get-ChildItem "*.png" | ForEach-Object { npx gemini-watermark-remove $_.FullName }
Technical Principles
Reverse Alpha Blending Algorithm:原始像素 = (當前像素 - α × 浮水印顏色) / (1 - α)
- ≤1024px: 48×48 mask, 32px margin
- >1024px: 96×96 mask, 64px margin
Links
- npm: https://www.npmjs.com/package/gemini-watermark-remove
- GitHub: https://github.com/kevintsai1202/GeminiWatermarkRemoveSkill
License
MIT License