用途:移除 Google Gemini(Nano Banana)生成图片中的浮水印,完全在本地执行,无需将图片上传至任何服务器。
主要能力:采用逆向 Alpha 混合算法还原被浮水印覆盖的像素,公式为:原始像素 = (当前像素 - α × 浮水印颜色) / (1 - α)。根据图片尺寸自动选择遮罩:≤1024px 使用 48×48 遮罩、边距 32px;>1024px 使用 96×96 遮罩、边距 64px。
使用方式:推荐用 npx 直接执行,无需安装: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。若 npx 失败,可改用 Node.js:先进入 skill 目录执行 npm install,再运行 node scripts/remove-watermark.js <图片路径>,参数同上。
参数:-o, --output 指定输出文件路径,默认 {文件名}_clean.{扩展名};-m, --mode 指定遮罩模式 auto、small、large,默认 auto;-g, --gain 指定 Alpha 增益值(1.0-3.0),默认 1.0。
批次处理示例(PowerShell):Get-ChildItem "*.png" | ForEach-Object { npx gemini-watermark-remove $_.FullName }。
适用场景:需要清理 Gemini 生成图片浮水印、且希望图片保留在本地的用户。
限制:资料未说明支持的具体图片格式范围、处理效果保证及性能表现;使用前请确认对目标图片拥有相应处理权限。项目采用 MIT License,npm 与 GitHub 链接见资料。