[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-79153":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":9,"totalLinesOfCode":9,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":9,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},79153,"GeminiWatermarkTool","allenk\u002FGeminiWatermarkTool","allenk","VEO \u002F Gemini 3.5 Nano Banana Pro watermark maintenance tool",null,"https:\u002F\u002Fgithub.com\u002Fallenk\u002FGeminiWatermarkTool","C++",2600,222,8,5,0,40,78,225,120,29.04,false,"main",[25,26,27,28,29],"cli-app","gemini","gui-application","veo3","watermark","2026-06-12 02:03:49","# Gemini Watermark Tool\n\n[![C++20](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FC++-20-blue.svg)](https:\u002F\u002Fen.cppreference.com\u002Fw\u002Fcpp\u002F20)\n[![Platform](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPlatform-Windows%20|%20Linux%20|%20macOS%20|%20Android-lightgrey.svg)](#system-requirements)\n[![AI Denoise](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAI-FDnCNN%20%2B%20Vulkan%20GPU-green.svg)](#ai-denoise--fdncnn-neural-network-new-in-v025)\n[![MCP](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMCP-Server%20Available-blue.svg)](https:\u002F\u002Fgithub.com\u002Fallenk\u002Fgwt-integrations)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-green.svg)](LICENSE)\n[![GitHub Stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fallenk\u002FGeminiWatermarkTool?style=social)](https:\u002F\u002Fgithub.com\u002Fallenk\u002FGeminiWatermarkTool)\n\n🆕 **Gemini 3.5 watermark profile supported, with automatic legacy fallback** (v0.3.1) — the CLI tries the current Gemini 3.5+ profile first; if detection skips, it automatically retries with the legacy (pre-3.5) profile. Disable with `--no-legacy`, or pin legacy directly with `--legacy`. [Details below](#-gemini-35-support--new).\n\n📢 **Now available: [Veo Video Watermark Remover](https:\u002F\u002Fgithub.com\u002Fallenk\u002FVeoWatermarkRemover)** — remove Google Veo \"Veo\" text watermarks from videos, same reverse alpha blending engine. Demo build (Win x64).\n\n▶️ **Watch: [GeminiWatermarkTool — Quick Start & Feature Overview](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=0jux3AJVb2Q)**\n\n> ## 📌 Original Author Notice (Reverse Alpha Blending)\n> I am the original author of **GeminiWatermarkTool** and the reverse **alpha-blending** restoration method used to remove the visible \"Gemini\" watermark while preserving image detail (Allen Kuo \u002F allenk).\n>\n> This project achieves high-precision restoration by using my calibrated **48×48** and **96×96** **Reverse-Alpha Masks** to invert the blending equation. Since I published this work and these assets, many derivative tools (desktop apps, websites, browser extensions, etc.) have appeared using the same approach and\u002For directly reusing the masks produced by this project — because the method is deterministic and highly effective.\n>\n> ✅ **MIT License reminder**  \n> This project is released under the **MIT License**. Commercial use and ports are allowed.  \n> However, if you **redistribute** any substantial portion of this project (including code or mask assets), you must:\n> - Preserve the original **copyright notice**\n> - Include the full **MIT license text**\n> - (Recommended) Provide attribution with a link back to this repository\n>\n> 📖 For the full technical write-up (including how the Reverse-Alpha Masks were derived and calibrated), see:  \n> **Removing Gemini AI Watermarks: A Deep Dive into Reverse Alpha Blending**  \n> https:\u002F\u002Fallenkuo.medium.com\u002Fremoving-gemini-ai-watermarks-a-deep-dive-into-reverse-alpha-blending-bbbd83af2a3f\n\nGemini Watermark Tool removes Gemini visible watermarks from images using a **mathematically accurate reverse alpha blending algorithm**.  \nUnlike many tools that rely entirely on generative inpainting, this project focuses on **deterministic reconstruction** combined with lightweight AI-assisted cleanup.\n\nThe design philosophy is simple:  \n**small, standalone, fast, and reliable.**\n\nThe entire toolkit is distributed as a **portable executable with zero runtime dependencies**, making it easy to install, automate, and integrate into scripts or pipelines without complex setup.\n\nKey capabilities include:\n\n- **Fast & offline**: single executable, **no external services or dependencies**\n- **Standalone & portable**: small footprint, easy to deploy and use anywhere\n- **GUI + CLI**: drag-and-drop desktop workflow or command-line automation\n- **Deterministic watermark reconstruction**: reverse alpha blending algorithm designed specifically for Gemini watermark overlays\n- **AI-assisted cleanup**: optional GPU-accelerated FDnCNN denoise (NCNN + Vulkan) for residual artifacts\n- **Smart detection**: three-stage NCC detection with confidence scoring to automatically skip non-watermarked images\n- **Batch processing**: process entire directories with preview and progress tracking\n- **Cross-platform**: Windows \u002F Linux \u002F macOS \u002F Android (CLI)\n- **AI Agent ready**: [Claude Code Skill + MCP Server](https:\u002F\u002Fgithub.com\u002Fallenk\u002Fgwt-integrations) for automation and agent workflows\n\n## ✨ Gemini 3.5 Support — New\n\n> **GeminiWatermarkTool now supports the new Gemini 3.5 watermark layout out of the box.**\n> Starting with Gemini 3.5, Google shifted the watermark position and updated its alpha map relative to legacy Gemini outputs. The tool targets the new profile by default and ships a one-click **Legacy** toggle for pre-3.5 outputs — no command-line flags or re-calibration needed.\n\n![Gemini 3.5 Preview](artworks\u002Fgemini_35_preview.png)\n\n| | Gemini 3.5+ (default) | Legacy (pre-Gemini 3.5) |\n|---|---|---|\n| **Profile** | V2 | V1 |\n| **Small logo** | 36×36 | 48×48 |\n| **Large logo** | 96×96 | 96×96 |\n| **Margin** | shifted (per-aspect calibrated) | original |\n| **GUI** | \"Auto Detect\" \u002F \"Small\" \u002F \"Large\" radios | tick **\"Legacy (pre-Gemini 3.5)\"** checkbox |\n| **CLI** | default | pass `--legacy` |\n\nBoth profiles use the same deterministic reverse alpha blending pipeline — switching profiles only changes the alpha map and position formula, not the math.\n\n### Automatic Legacy Fallback (v0.3.1, CLI only)\n\nThe CLI default now handles mixed Gemini-3.5+ and pre-3.5 inputs without\nthe user having to script the retry. When the current-profile detector\nreturns *skipped* (confidence below threshold), the CLI automatically\nruns the same image through the legacy profile before reporting the\nfinal outcome. Behaviour matrix:\n\n| Invocation | First attempt | Fallback | Notes |\n|---|---|---|---|\n| `GeminiWatermarkTool image.png` | V2 (current) | V1 if V2 skips | new v0.3.1 default |\n| `GeminiWatermarkTool --legacy image.png` | V1 only | — | pin legacy, no fallback |\n| `GeminiWatermarkTool --no-legacy image.png` | V2 only | — | matches v0.3.0 default |\n| `GeminiWatermarkTool --legacy --no-legacy …` | — | — | conflict, exits 2 |\n\nThe safety contract is unchanged: each profile attempt is still gated\nby the confidence threshold, so non-Gemini images skip on both V2 and\nV1 and remain untouched. The GUI is unchanged — its Legacy checkbox is\nexplicit, no automatic fallback.\n\n### Exit Codes (v0.3.1)\n\nThe CLI now returns distinct exit codes so scripts can chain retries\nwithout inspecting stdout or checking for an output file:\n\n| Code | Meaning |\n|---|---|\n| **0** | File processed (or batch directory completed with no errors) |\n| **1** | Single-file invocation skipped — no watermark detected on any tried profile |\n| **2** | Real failure — bad arguments, missing input, IO\u002Fwrite error |\n\nBatch directory mode (`-i somedir -o somedir`) keeps lenient semantics:\nexit 0 unless something actually fails, since partial skips are normal\nwhen scanning a folder.\n\nExample Windows shell chain:\n\n```bat\nGeminiWatermarkTool.exe -i image.png -o clean.png\nif %ERRORLEVEL% equ 1 (\n    rem auto-fallback tried both V2 and V1 and skipped; user may want --force\n    GeminiWatermarkTool.exe -i image.png -o clean.png --force\n)\n```\n\n## 🎬 Veo Video Watermark Removal — Demo Available\n\n> **NEW:** GeminiWatermarkTool now supports removing **Google Veo** video watermarks.\n> The same reverse alpha blending engine, now for video — direct mp4-to-mp4, with audio preserved.\n\nA standalone demo build (Windows x64) is available for testing:\n\n**[VeoWatermarkRemover — Download Demo](https:\u002F\u002Fgithub.com\u002Fallenk\u002FVeoWatermarkRemover)**\n\n- Drag & drop your Veo `.mp4` file onto the exe — done\n- 36 MB standalone, zero dependencies\n- 720p ~50 fps, 1080p ~18 fps\n- AI denoise + audio passthrough included\n\n> Cross-platform support and GUI integration are coming soon.\n> This Veo feature will be merged into GeminiWatermarkTool when stable.\n\n## 🖥️ GUI Application — Major Update\n\n> **GeminiWatermarkTool now comes with a full graphical desktop application.**\n> No command line needed — just open, drag & drop, and process. Supports single-image editing with real-time preview, and batch processing with smart watermark detection.\n\nThe desktop GUI provides an interactive workflow for both single-image and batch operations.\n\n![GUI Demo](artworks\u002Fgui_demo.png)\n\n## AI Agent - Integration (New in v0.2.5)\nGeminiWatermarkTool can now be integrated into AI-agent workflows via MCP server and Claude Code skills.\nThis enables automated watermark processing inside agent-based pipelines.\n\n> **[gwt-integrations](https:\u002F\u002Fgithub.com\u002Fallenk\u002Fgwt-integrations)** — Claude Code Skill + MCP Server for GeminiWatermarkTool\n\nEnable AI coding agents (Claude Code, Cursor, Windsurf, etc.) to use GeminiWatermarkTool directly:\n\n| Component | Description |\n|-----------|-------------|\n| **Claude Code Skill** | Teaches AI agents GWT's full CLI syntax, region\u002Fsnap\u002Fdenoise options, and best practices — agents can remove watermarks from images without manual guidance |\n| **MCP Server** | Exposes GWT as 4 tools via [Model Context Protocol](https:\u002F\u002Fmodelcontextprotocol.io\u002F) — `remove_watermark`, `detect_watermark`, `batch_process`, `get_tool_info` — any MCP-compatible client can call them |\n| **install.py** | Cross-platform installer (stdlib only) — auto-detects GWT binary, configures Claude Code skill and MCP server in one command |\n\n\n![AI MCP Skill](artworks\u002Fgwt-mcp.gif)\n\n### Single Image Editing\n\n![GUI Single Image](artworks\u002Fgui_single.gif)\n\n- Drag & drop or open any supported image\n- Auto-detect watermark size (48×48 \u002F 96×96) or select manually\n- **Custom watermark mode**: draw a search region interactively, resize with 8-point anchors, fine-tune position with WASD keys\n- **Multi-scale guided detection (Snap Engine)**: coarse-to-fine NCC template matching auto-locks to the exact watermark position within your drawn region — supports variable sizes from 16–320px with adjustable Min Size and Max Size sliders (Min Size default 16px covers Gemini preview-tier watermarks ~28px)\n- Real-time before\u002Fafter comparison (press **V**)\n- One-key processing (**X**) and revert (**Z**)\n- Zoom, pan (Space\u002FAlt + drag, mouse wheel), and fit-to-window\n\n### Software Inpainting Cleanup (New in v0.2.3)\n\n![Software Inpainting](artworks\u002Fgui_inpaint_sw.gif)\n\nReverse alpha blending is mathematically exact — but only when the image hasn't been resized, recompressed, or processed after watermarking. In practice, many images go through post-processing that breaks the pixel-perfect math, leaving faint residual artifacts after removal.\n\n**Software Inpainting** addresses this by applying a lightweight cleanup pass after the reverse blending step. It uses gradient-weighted masks derived from the watermark's own alpha channel to target only the residual pixels, leaving the rest of the image untouched.\n\nThree built-in methods are available:\n\n| Method | Description | Best for |\n|--------|-------------|----------|\n| **NS** | Navier-Stokes based inpainting — propagates surrounding pixel flow into the damaged region | General-purpose cleanup with smooth results |\n| **TELEA** | Fast marching method — fills inward from boundary pixels based on distance weighting | Quick processing, good for small residuals |\n| **Soft Inpaint** | Gradient-weighted Gaussian blend — uses the watermark alpha as a soft mask for weighted blending | Preserving fine texture in photographic content |\n\nThe cleanup controls appear automatically in **Custom** mode under the Detected Info panel. You can adjust the **method**, **strength** (0–100%), and **inpaint radius** (1–25 px) to fine-tune the result.\n\n### AI Denoise — FDnCNN Neural Network (New in v0.2.5)\n\n![AI Denoise](artworks\u002Fgui_inpaint_ai_fdncnn.gif)\n\n**AI Denoise** uses a GPU-accelerated neural network ([FDnCNN](https:\u002F\u002Fgithub.com\u002Fcszn\u002FKAIR)) to clean up watermark residuals that conventional inpainting methods struggle with — particularly the faint sparkle edges and corner artifacts left after reverse alpha blending on resized images.\n\nUnlike NS\u002FTELEA which require a binary mask to know *which* pixels are damaged, AI Denoise examines a 41×41 pixel neighborhood around each point and learns from training data what \"normal\" image content looks like. Combined with gradient-masked blending from the alpha map, it repairs only the artifact pixels while preserving clean background detail.\n\n| Parameter | Range | Default | Description |\n|-----------|-------|---------|-------------|\n| **Strength** | 0–300% | 120% | Controls mask coverage — values above 100% expand repair to weaker gradient edges |\n| **Sigma** | 1–150 | 50 | Noise level estimation — higher values denoise more aggressively |\n\n**Technical details:**\n- **Model**: FDnCNN Color, 20-layer Conv+ReLU, FP16 (~1.3 MB embedded in executable)\n- **Inference**: [NCNN](https:\u002F\u002Fgithub.com\u002FTencent\u002Fncnn) with Vulkan GPU acceleration, automatic CPU fallback\n- **Pipeline**: gradient mask from alpha map → NCNN inference on padded ROI → per-pixel masked blend\n- **Performance**: \u003C 5 ms per region on modern GPUs, ~20 ms on CPU\n\nAI Denoise is the **recommended default** when available. The GPU device name is displayed below the controls. If GPU initialization fails, the tool automatically falls back to NS inpainting.\n\n### Batch Processing\n\n\u003C!-- TODO: Replace with actual GIF -->\n![GUI Batch Processing](artworks\u002Fgui_batch.gif)\n\n- **Drag & drop** multiple files or an **entire folder** to enter batch mode\n- Thumbnail atlas preview with filename labels and status overlays (OK \u002F SKIP \u002F FAIL)\n- **Detection threshold slider** (0–100%, 5% steps, 25% recommended) — automatically skip images without watermarks\n- Confirmation dialog before overwriting originals\n- Non-blocking processing with progress bar and scrollable result log\n- Thumbnails refresh after completion to show processed results\n\n### Keyboard Shortcuts\n\n| Key | Action |\n|-----|--------|\n| X | Process image |\n| V | Compare with original |\n| Z | Revert to original |\n| C (hold) | Hide overlay |\n| W A S D | Move custom watermark region |\n| Space \u002F Alt | Pan (hold + drag) |\n| Scroll | Zoom to cursor |\n| Ctrl +\u002F- | Zoom in \u002F out |\n| Ctrl 0 | Zoom fit |\n| Ctrl+W | Close \u002F exit batch mode |\n\n### Render Backends (Windows)\n\nThe GUI supports multiple render backends for maximum compatibility:\n\n| Backend | Description | Use Case |\n|---------|-------------|----------|\n| **D3D11** (default) | Direct3D 11 with WARP fallback | Best for Windows — works in Hyper-V, Docker, RDP |\n| **OpenGL** | OpenGL 3.3 Core | Cross-platform, requires GPU drivers |\n\n**Why D3D11?**\n- Native Windows API — no additional drivers needed\n- **WARP fallback** — software rendering when no GPU available\n- Works in **Hyper-V**, **Docker**, **Remote Desktop**, and other virtualized environments\n- Better stability in Windows sandbox configurations\n\n```bash\n# Auto-select (D3D11 on Windows, OpenGL elsewhere)\nGeminiWatermarkTool\n\n# Force specific backend\nGeminiWatermarkTool --backend=d3d11\nGeminiWatermarkTool --backend=opengl\n```\n\n## CLI — What's New\n\nIn addition to the GUI, the command line has been significantly enhanced.\n\n### Simple Mode — Now Supports Multiple Files\n\n```bash\n# Process multiple files at once (new!)\nGeminiWatermarkTool img1.jpg img2.png img3.webp\n```\n\nWatermark detection is **enabled by default** in simple mode — images without a detectable watermark are automatically skipped to prevent accidental damage.\n\n```bash\n# Force processing without detection\nGeminiWatermarkTool --force image.jpg\n\n# Custom detection threshold (default: 25%)\nGeminiWatermarkTool --threshold 0.40 image.jpg\n```\n\n### Standard Mode\n\n```bash\n# Single file with explicit output\nGeminiWatermarkTool -i input.jpg -o output.jpg\n\n# Batch directory processing\nGeminiWatermarkTool -i .\u002Fwatermarked_images\u002F -o .\u002Fclean_images\u002F\n```\n\n## Watermark Detection\n\n> Inspired by [@dannycreations](https:\u002F\u002Fgithub.com\u002Fdannycreations)'s [contribution](https:\u002F\u002Fgithub.com\u002Fallenk\u002FGeminiWatermarkTool\u002Fpull\u002F13) on watermark presence detection. We took the concept further with a production-grade three-stage algorithm deeply integrated into both CLI and GUI workflows.\n\nBatch processing watermark-free images can cause unnecessary pixel damage. The tool now uses a **three-stage NCC (Normalized Cross-Correlation)** algorithm to detect watermarks before processing, ensuring only watermarked images are modified:\n\n1. **Spatial NCC** — correlates the image region with the known alpha map (50% weight, with circuit breaker at 0.25 to short-circuit obvious non-matches)\n2. **Gradient NCC** — Sobel edge matching to detect the star-shaped structural pattern (30% weight)\n3. **Statistical Variance** — texture dampening analysis to distinguish real watermarks from white\u002Fflat regions (20% weight)\n\nA combined confidence score determines whether a watermark is present. The default threshold is **25%** — images below this score are skipped. This eliminates false positives from white backgrounds or similar-looking content that plagued simpler correlation-based approaches.\n\n| Flag | Effect |\n|------|--------|\n| `--force` | Skip detection, process all images unconditionally |\n| `--threshold 0.40` | Set custom confidence threshold (0.0–1.0) |\n| `--no-banner` | Hide ASCII banner (for scripts and AI agents) |\n| `--banner` | Force show ASCII banner |\n\nDetection is **enabled by default** in simple\u002Fdrag-and-drop mode and **disabled by default** in standard (`-i` \u002F `-o`) mode. In the GUI, the threshold is adjustable via a slider (0–100%, 5% steps) with a recommended 25% default.\n\n## Demo\n\n![Comparison](artworks\u002Fdemo.gif)\n\n## Side by Side Comparison\n\n![Comparison](artworks\u002Fcomparison.png)\nBest for: **slides, documents, UI screenshots, diagrams, logos**.\n\n**Focus on the bottom example (text-heavy slide).**  \nGenerative inpainting often breaks text: warped edges, wrong spacing, invented strokes.  \nGeminiWatermarkTool reverses the blending equation to recover pixels, keeping text crisp.\n\n---\n\n## ⚠️ About SynthID (Invisible Watermark)\n\n> **Important**: This tool removes **visible watermarks only**. It does NOT remove SynthID.\n\n### What is SynthID?\n\nSynthID is Google DeepMind's **invisible watermarking** technology, deployed across Google services including Gemini, Imagen, Lyria, and Veo.\n\nIt is best understood as a **family of technologies** rather than a single algorithm — text, image, audio, and video each use different underlying mechanisms. For images specifically, according to Gowal et al. (2025), SynthID-Image is a **post-hoc, model-independent encoder-decoder approach**: the watermark is added by a trained encoder after the image has been generated.\n\nKey properties:\n\n- **Invisible** to human eyes\n- **Robust** against common image transformations (compression, noise, rotation, color changes, etc.)\n- **Adversarially trained** to resist most simple removal attacks\n\n### Why Can't SynthID Be Removed Easily?\n\nEven though the watermark is technically \"added\" by the encoder, the encoder is a deep neural network trained adversarially. The perturbation it adds is distributed in a high-dimensional learned representation, not as a fixed pixel pattern. As a result:\n\n- Random or symmetric attacks tend to be orthogonal to the encoder's learned direction\n- Most common transformations were already part of the encoder's training augmentation\n- The watermark is entangled with image features rather than localized\n\nIn practice, removing SynthID without significantly degrading image quality is **currently not feasible** with publicly available tools.\n\n### Removal Approaches Studied\n\n| Approach | Trade-off | Feasibility |\n|----------|-----------|-------------|\n| **Extreme Quantization** (binarization) | Image becomes unusable skeleton | Works |\n| **AI Re-generation** (Stable Diffusion, etc.) | Style and details change | Works |\n| **Adversarial \u002F Surrogate Attacks** | Requires decoder access or paired data | Not currently practical |\n\n📄 **[Full SynthID Research Report →](report\u002Fsynthid_research.md)**\n\n---\n\n## Download\n\nDownload the latest release from the [Releases](https:\u002F\u002Fgithub.com\u002Fallenk\u002FGeminiWatermarkTool\u002Freleases) page.\n\n| Platform | File | Architecture |\n|----------|------|--------------|\n| Windows | `GeminiWatermarkTool-Windows-x64.exe` | x64 |\n| Linux | `GeminiWatermarkTool-Linux-x64` | x64 |\n| macOS | `GeminiWatermarkTool-macOS-Universal` | Intel + Apple Silicon |\n| Android | `GeminiWatermarkTool-Android-arm64` | ARM64 |\n\n### gwt-mini — Minimal CLI Build\n\nA separate, much smaller CLI-only build is published alongside each release for users\nwho do not need the desktop GUI (servers, CI pipelines, scripted batch processing).\n`gwt-mini` keeps full functionality — reverse alpha blending, three-stage NCC\ndetection, snap search, and AI denoise (NCNN + embedded FDnCNN weights) — and drops\nonly the ImGui \u002F SDL3 \u002F GPU-backend stack. Windows and Linux builds are additionally\nUPX-compressed.\n\n| Platform | File | Approx. size |\n|----------|------|--------------|\n| Windows | `gwt-mini-windows-x64.zip` | ~5 MB (UPX) |\n| Linux | `gwt-mini-linux-x64.zip` | ~7 MB (UPX) |\n| macOS | `gwt-mini-macos-universal.zip` | ~23 MB (universal, no UPX) |\n\nCLI flags are identical to the full build — see [CLI — Quick Start](#cli--quick-start).\n\nCaveats:\n- Some corporate antivirus engines (Defender ATP, CrowdStrike, etc.) may flag UPX-packed\n  executables as suspicious. If that is a concern, use the full `GeminiWatermarkTool`\n  binary instead — it is not packed.\n- UPX adds a small one-off decompression cost at startup (~20–50 ms).\n- macOS is not UPX-compressed: UPX interacts badly with codesigning and Gatekeeper on\n  modern macOS.\n\nTo build `gwt-mini` yourself, see [Build — gwt-mini (minimal CLI)](#build--gwt-mini-minimal-cli) below.\n\n### First Run — OS Security Prompts\n\nDownloaded binaries are not code-signed, so your OS may show a security warning on first launch. This is normal for open-source software distributed outside app stores.\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>macOS\u003C\u002Fb> — \"Apple cannot check it for malicious software\"\u003C\u002Fsummary>\n\n**Option A (recommended):** Right-click the binary → **Open** → click **Open** in the dialog. You only need to do this once.\n\n**Option B (terminal):**\n```bash\nxattr -dr com.apple.quarantine GeminiWatermarkTool\nchmod +x GeminiWatermarkTool\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Windows\u003C\u002Fb> — SmartScreen \"Windows protected your PC\"\u003C\u002Fsummary>\n\n**Option A:** Click **More info** → **Run anyway**.\n\n**Option B (PowerShell):**\n```powershell\nUnblock-File .\\GeminiWatermarkTool.exe\n```\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Linux\u003C\u002Fb> — No security prompt\u003C\u002Fsummary>\n\nLinux does not quarantine downloaded binaries. Just ensure the file is executable:\n```bash\nchmod +x GeminiWatermarkTool\n.\u002FGeminiWatermarkTool\n```\n\u003C\u002Fdetails>\n\n## ⚠️ Disclaimer\n\n> **USE AT YOUR OWN RISK**\n>\n> This tool modifies image files. While it is designed to work reliably, unexpected results may occur due to:\n> - Variations in Gemini's watermark implementation\n> - Corrupted or unusual image formats\n> - Edge cases not covered by testing\n>\n> **Always back up your original images before processing.**\n>\n> The author assumes no responsibility for any data loss, image corruption, or unintended modifications. By using this tool, you acknowledge that you understand these risks.\n\n## CLI — Quick Start\n\n\u003Cimg src=\"artworks\u002Fapp_ico.png\" alt=\"App Icon\" width=\"256\" height=\"256\">\n\nDon't need the GUI? The CLI is designed for **maximum simplicity** — one drag, one drop, done.\n\n### Drag & Drop (Windows) — The Easiest Way\n\n1. Download `GeminiWatermarkTool-Windows-x64.exe`\n2. Drag an image file onto the executable\n3. ✅ Done! The watermark is removed in-place — no terminal, no arguments\n\n\u003C!-- CLI Preview -->\n![Preview](artworks\u002Fpreview.png)\n\n### Command Line\n\n```bash\n# Simple mode - just provide a filename\nGeminiWatermarkTool watermarked.jpg\n\n# Specify output file (preserves original)\nGeminiWatermarkTool -i watermarked.jpg -o clean.jpg\n\n# Batch processing - entire directory\nGeminiWatermarkTool -i .\u002Finput_folder\u002F -o .\u002Foutput_folder\u002F\n```\n\nSupported formats: `.jpg`, `.jpeg`, `.png`, `.webp`, `.bmp`\n\n> ⚠️ **Warning**: Simple mode overwrites the original file permanently. **Always back up important images before processing.**\n\n## Command Line Options\n\n| Option | Short | Description |\n|--------|-------|-------------|\n| `--input \u003Cpath>` | `-i` | Input image file or directory |\n| `--output \u003Cpath>` | `-o` | Output image file or directory |\n| `--remove` | `-r` | Remove watermark (default behavior) |\n| `--force` | `-f` | Force processing (skip watermark detection) |\n| `--threshold \u003Cval>` | `-t` | Detection confidence threshold, 0.0–1.0 (default: 0.25) |\n| `--force-small` | | Force 48×48 watermark size |\n| `--force-large` | | Force 96×96 watermark size |\n| `--verbose` | `-v` | Enable verbose output |\n| `--quiet` | `-q` | Suppress all output except errors |\n| `--banner` | `-b` | Show full ASCII banner |\n| `--version` | `-V` | Show version information |\n| `--help` | `-h` | Show help message |\n\n### Advanced Options (v0.2.5)\n\n| Option | Description |\n|--------|-------------|\n| `--region \u003Cspec>` | Explicit watermark region (see Region Syntax below) |\n| `--fallback-region \u003Cspec>` | Search region when standard detection fails |\n| `--snap` | Enable multi-scale snap search within region |\n| `--snap-min-size \u003CN>` | Min snap search size, 8–64 (default: 16) |\n| `--snap-max-size \u003CN>` | Max snap search size, 32–320 (default: 160) |\n| `--snap-threshold \u003CN>` | Min snap confidence to accept, 0.0–1.0 (default: 0.60) |\n| `--denoise \u003Cmethod>` | Cleanup after removal: `ai`, `ns`, `telea`, `soft`, `off` |\n| `--sigma \u003CN>` | AI denoise noise level, 1–150 (default: 50) |\n| `--strength \u003CN>` | Denoise strength %, 0–300 (default: 120 for AI, 85 for others) |\n| `--radius \u003CN>` | Inpaint radius for NS\u002FTELEA\u002FSoft, 1–25 (default: 10) |\n\n**Region syntax:**\n\n| Format | Description |\n|--------|-------------|\n| `x,y,w,h` | Absolute coordinates |\n| `br:mx,my,w,h` | Bottom-right corner (margin_x, margin_y, width, height) |\n| `bl:mx,my,w,h` | Bottom-left corner |\n| `tr:mx,my,w,h` | Top-right corner |\n| `tl:mx,my,w,h` | Top-left (same as absolute) |\n| `br:auto` | Use Gemini default position based on image size |\n\n**Examples:**\n\n```bash\n# Standard removal with AI denoise cleanup\nGeminiWatermarkTool -i input.jpg -o clean.jpg --denoise ai\n\n# Batch with AI denoise (all files)\nGeminiWatermarkTool -i .\u002Fphotos\u002F -o .\u002Fclean\u002F --denoise ai\n\n# Fallback for images that fail detection: search bottom-right area with snap\nGeminiWatermarkTool -i .\u002Fphotos\u002F -o .\u002Fclean\u002F \\\n    --fallback-region br:auto --snap --denoise ai\n\n# Resized watermarks: expand snap search to 320px\nGeminiWatermarkTool -i .\u002Fphotos\u002F -o .\u002Fclean\u002F \\\n    --fallback-region br:80,80,200,200 --snap --snap-max-size 320 --denoise ai\n\n# Gemini preview images (small ~28px watermark): use lower snap-threshold\nGeminiWatermarkTool -i preview.jpg -o clean.jpg \\\n    --fallback-region br:auto --snap --snap-threshold 0.30 --denoise ai --sigma 13 --strength 175\n\n# Force process at explicit region (all images have watermark at same spot)\nGeminiWatermarkTool -i .\u002Fphotos\u002F -o .\u002Fclean\u002F \\\n    --force --region 500,800,160,160 --snap --denoise ai --sigma 75\n```\n\n> **Note:** When no `--denoise` is specified, the CLI behaves identically to previous versions (no cleanup pass). All existing scripts and agent integrations continue to work unchanged.\n\n## Watermark Size Detection\n\nThe tool automatically detects the appropriate watermark size based on image dimensions:\n\n| Image Size | Watermark | Position |\n|------------|-----------|----------|\n| W ≤ 1024 **or** H ≤ 1024 | 48×48 | Bottom-right, 32px margin |\n| W > 1024 **and** H > 1024 | 96×96 | Bottom-right, 64px margin |\n\nUse `--force-small` or `--force-large` to override automatic detection.\n\n## System Requirements\n\n| Platform | Requirements |\n|----------|--------------|\n| Windows | Windows 10\u002F11 x64 |\n| Linux | x64, glibc 2.35+ (Ubuntu 22.04+, Debian 12+) |\n| macOS | macOS 11.0+ (Intel or Apple Silicon) |\n| Android | ARM64, Android 10+ (API 29+) |\n\nAll binaries are statically linked with no external runtime dependencies.\n\n> **AI Denoise** uses Vulkan for GPU acceleration. Most modern GPUs (NVIDIA, AMD, Intel) with up-to-date drivers support Vulkan. If no Vulkan GPU is detected, inference automatically falls back to CPU (OpenMP multi-threaded).\n\n## Troubleshooting\n\n### \"The image doesn't look different after processing\"\n\nThe watermark is semi-transparent. If the original background was similar to the watermark color, the difference may be subtle. Try viewing at 100% zoom in the watermark area (bottom-right corner).\n\n### \"Wrong watermark size detected\"\n\nUse `--force-small` or `--force-large` to manually specify:\n\n```bash\nGeminiWatermarkTool -i image.jpg -o output.jpg --force-small\n```\n\n### \"File access denied\"\n\nMake sure the output path is writable and the file isn't open in another program.\n\n## Limitations\n\n- Only removes **Gemini visible watermarks** (the semi-transparent logo in bottom-right)\n- Does **NOT** remove **SynthID invisible watermarks** — [see why](report\u002Fsynthid_research.md)\n- Designed for Gemini's current watermark pattern (as of 2025)\n\n---\n\n## Building from Source\n\n### Prerequisites\n\n| Tool | Version | Notes |\n|------|---------|-------|\n| CMake | 3.21+ | For CMakePresets support |\n| C++ Compiler | C++20 | MSVC 2022, GCC 12+, Clang 14+ |\n| vcpkg | Latest | Package manager |\n| Ninja | Latest | Recommended build system |\n\n### Setup vcpkg\n\n```bash\n# Clone vcpkg\ngit clone https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvcpkg.git\ncd vcpkg\n\n# Bootstrap\n.\u002Fbootstrap-vcpkg.sh    # Linux\u002FmacOS\n.\\bootstrap-vcpkg.bat   # Windows\n\n# Set environment variable\nexport VCPKG_ROOT=\"$HOME\u002Fvcpkg\"       # Linux\u002FmacOS (add to .bashrc)\n$env:VCPKG_ROOT = \"C:\\vcpkg\"          # Windows PowerShell\n```\n\n### Build with CMake Presets\n\nThe project uses `CMakePresets.json` for cross-platform configuration.\n\n```bash\n# Clone with submodules (NCNN source)\ngit clone --recursive https:\u002F\u002Fgithub.com\u002Fallenk\u002FGeminiWatermarkTool.git\n\n# Or if already cloned:\ngit submodule update --init --recursive\n\n# List available presets\ncmake --list-presets\n```\n\n#### Windows\n\n```powershell\ncmake --preset windows-x64-Release\ncmake --build --preset windows-x64-Release\n```\n\n#### Linux\n\n```bash\ncmake --preset linux-x64-Release\ncmake --build --preset linux-x64-Release\n```\n\n#### macOS (Universal Binary)\n\nmacOS requires separate builds for each architecture:\n\n```bash\n# Build x64\ncmake -B build-x64 -G Ninja \\\n  -DCMAKE_BUILD_TYPE=Release \\\n  -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT\u002Fscripts\u002Fbuildsystems\u002Fvcpkg.cmake \\\n  -DVCPKG_TARGET_TRIPLET=x64-osx \\\n  -DCMAKE_OSX_ARCHITECTURES=x86_64\ncmake --build build-x64\n\n# Build arm64\ncmake -B build-arm64 -G Ninja \\\n  -DCMAKE_BUILD_TYPE=Release \\\n  -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT\u002Fscripts\u002Fbuildsystems\u002Fvcpkg.cmake \\\n  -DVCPKG_TARGET_TRIPLET=arm64-osx \\\n  -DCMAKE_OSX_ARCHITECTURES=arm64\ncmake --build build-arm64\n\n# Create Universal Binary\nlipo -create build-x64\u002FGeminiWatermarkTool build-arm64\u002FGeminiWatermarkTool \\\n  -output GeminiWatermarkTool\n```\n\n#### Android\n\nRequires Android NDK:\n\n```bash\nexport ANDROID_NDK_HOME=\"\u002Fpath\u002Fto\u002Fandroid-ndk\"\n\ncmake --preset android-arm64-Release\ncmake --build --preset android-arm64-Release\n```\n\n### Build Presets\n\n| Preset | Platform | Backend | Notes |\n|--------|----------|---------|-------|\n| `windows-x64-Release` | Windows | D3D11 + OpenGL | Default, includes AI Denoise |\n| `windows-x64-OpenGL-Release` | Windows | OpenGL only | Includes AI Denoise |\n| `linux-x64-Release` | Linux | OpenGL | Includes AI Denoise |\n| `mac-universal-Release` | macOS | OpenGL | Intel + Apple Silicon, includes AI Denoise |\n| `android-arm64-Release` | Android | — | CLI only, includes AI Denoise |\n\nAll presets enable `ENABLE_AI_DENOISE=ON` by default. To build without AI, set `-DENABLE_AI_DENOISE=OFF` manually.\n\n### Manual Build (without presets)\n\n```bash\ncmake -B build -G Ninja \\\n  -DCMAKE_BUILD_TYPE=Release \\\n  -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT\u002Fscripts\u002Fbuildsystems\u002Fvcpkg.cmake \\\n  -DVCPKG_TARGET_TRIPLET=x64-linux\n\ncmake --build build\n```\n\n### Build — gwt-mini (minimal CLI)\n\nFor the published `gwt-mini` variant: GUI off, AI denoise on, no video pipeline.\n\n```bash\n# Linux\ncmake -B build-mini -G Ninja \\\n  -DCMAKE_BUILD_TYPE=Release \\\n  -DBUILD_GUI=OFF \\\n  -DENABLE_AI_DENOISE=ON \\\n  -DENABLE_VIDEO=OFF \\\n  -DVCPKG_MANIFEST_FEATURES=\"ai-denoise\" \\\n  -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT\u002Fscripts\u002Fbuildsystems\u002Fvcpkg.cmake\ncmake --build build-mini\nstrip build-mini\u002FGeminiWatermarkTool\n# Optional: shrink further with UPX\nupx --best --lzma build-mini\u002FGeminiWatermarkTool\n```\n\nOn Windows add `-DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded`.\nOn macOS build x86_64 and arm64 separately, then `lipo -create` them into a universal binary\n(same recipe as `mac-universal-Release`, just with the flags above).\n\n---\n\n## Project Structure\n\n```\ngemini-watermark-tool\u002F\n├── CMakeLists.txt              # Main build configuration\n├── CMakePresets.json           # Cross-platform build presets\n├── vcpkg.json                  # Dependencies manifest\n├── src\u002F\n│   ├── core\u002F                   # Core engine (CLI + GUI shared)\n│   │   ├── watermark_engine.hpp\u002Fcpp\n│   │   ├── watermark_detector.hpp\u002Fcpp\n│   │   ├── blend_modes.hpp\u002Fcpp\n│   │   ├── ai_denoise.hpp\u002Fcpp         # NCNN FDnCNN denoiser\n│   │   ├── ai_denoise_model.cpp       # Embedded model weights (isolated TU)\n│   │   ├── ncnn_shim.hpp              # Vulkan loader shim for NCNN\n│   │   └── types.hpp\n│   ├── cli\u002F                    # CLI application\n│   │   └── cli_app.hpp\u002Fcpp\n│   ├── utils\u002F                  # Utilities\n│   │   ├── ascii_logo.hpp\n│   │   └── path_formatter.hpp\n│   ├── main.cpp                # Entry point (CLI\u002FGUI dispatcher)\n│   └── gui\u002F                    # Desktop GUI (ImGui + SDL3)\n│       ├── gui_app.hpp\u002Fcpp           # GUI entry point\n│       ├── app\u002F\n│       │   ├── app_state.hpp         # Application state\n│       │   └── app_controller.hpp\u002Fcpp # Logic controller\n│       ├── widgets\u002F\n│       │   ├── main_window.hpp\u002Fcpp   # Main window + menus\n│       │   └── image_preview.hpp\u002Fcpp # Image viewer + batch view\n│       ├── backend\u002F\n│       │   ├── render_backend.hpp\u002Fcpp  # Backend interface + factory\n│       │   ├── opengl_backend.hpp\u002Fcpp  # OpenGL 3.3 implementation\n│       │   └── d3d11_backend.hpp\u002Fcpp   # Direct3D 11 implementation (Windows)\n│       └── resources\u002F\n│           └── style.hpp             # Theme and layout constants\n├── external\u002F\n│   └── ncnn\u002F                         # NCNN source (git submodule)\n│       └── model-convert\u002Foutput\u002F     # Converted FDnCNN model headers\n├── report\u002F\n│   └── synthid_research.md     # SynthID research documentation\n└── resources\u002F\n    ├── app.ico                 # Windows application icon\n    └── app.rc.in               # Windows resource template\n```\n\n## Dependencies\n\nAll dependencies are managed via vcpkg and statically linked:\n\n| Package | Purpose |\n|---------|---------|\n| OpenCV | Image I\u002FO and pixel operations |\n| fmt | Modern string formatting |\n| CLI11 | Command line argument parsing |\n| spdlog | Logging framework |\n| SDL3 | Window management and input (GUI) |\n| Dear ImGui | Immediate mode GUI framework (GUI) |\n| ImPlot | Plotting widgets (GUI) |\n| glad | OpenGL loader (GUI) |\n| nativefiledialog-extended | Native file dialogs (GUI) |\n| WIL | Windows Implementation Libraries (D3D11 backend, Windows only) |\n| NCNN | Neural network inference runtime (AI Denoise, git submodule) |\n| volk | Vulkan meta-loader for dynamic dispatch (AI Denoise, vcpkg) |\n\n---\n\n## How It Works\n\n### Gemini Watermark Analysis\n\nGemini applies visible watermarks using **alpha blending**:\n\n```\nwatermarked = α × logo + (1 - α) × original\n```\n\n### Alpha Reconstruction\n\nBy statistically analyzing and comparing values related to Alpha, we can reconstruct an Alpha Map that is either correct or very close to it.\n\n### Removal Algorithm (Reverse Alpha Blending)\n\nSolving for the original pixel:\n\n```\noriginal = (watermarked - α × logo) \u002F (1 - α)\n         = (watermarked - alpha_map) \u002F (1 - α)\n```\n\nThis mathematical inversion produces exact restoration of the original pixels.\n\n### Residual Cleanup (Software Inpainting + AI Denoise)\n\nWhen images have been resized or recompressed after watermarking, the exact math no longer holds perfectly. Two approaches are available for cleaning up residual artifacts:\n\n**Software Inpainting** (NS \u002F TELEA \u002F Gaussian):\n```\n1. Compute gradient magnitude from watermark alpha channel\n2. Build soft weight mask: stronger where alpha gradient is high\n3. Apply selected inpainting method (NS \u002F TELEA \u002F Gaussian blend)\n4. Blend result using weight mask — only affected pixels are modified\n```\n\n**AI Denoise** (FDnCNN, recommended):\n```\n1. Compute gradient mask from alpha map (locate sparkle edges)\n2. Run FDnCNN inference on padded ROI (Vulkan GPU or CPU)\n   Input:  [R, G, B, sigma\u002F255] → Output: denoised clean image\n3. Per-pixel masked blend: mask × denoised + (1-mask) × original\n   → Only edge artifacts repaired, clean background untouched\n```\n\n---\n\n## Legal Disclaimer\n\nThis tool is provided for **personal and educational use only**. \n\nThe removal of watermarks may have legal implications depending on your jurisdiction and the intended use of the images. Users are solely responsible for ensuring their use of this tool complies with applicable laws, terms of service, and intellectual property rights.\n\nThe author does not condone or encourage the misuse of this tool for copyright infringement, misrepresentation, or any other unlawful purposes.\n\n**THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY ARISING FROM THE USE OF THIS SOFTWARE.**\n\n## License\n\nMIT License\n\n## Author\n\n**Allen Kuo** ([@allenk](https:\u002F\u002Fgithub.com\u002Fallenk))\n- GitHub: https:\u002F\u002Fgithub.com\u002Fallenk  \n- LinkedIn: https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fallen-kuo-7b513a45\u002F\n- Medium: https:\u002F\u002Fallenkuo.medium.com\n\n**Quick start:**\n\n```bash\n# Install the integration (after GeminiWatermarkTool is on PATH)\ngit clone https:\u002F\u002Fgithub.com\u002Fallenk\u002Fgwt-integrations.git\ncd gwt-integrations\npython install.py\n```\n\nAfter installation, AI agents can process watermarks conversationally:\n\n```\n\"Remove the Gemini watermark from screenshot.png using AI denoise\"\n\"Batch process all images in .\u002Fphotos\u002F with fallback snap detection\"\n```\n\nSee [gwt-integrations README](https:\u002F\u002Fgithub.com\u002Fallenk\u002Fgwt-integrations) for full setup instructions and MCP configuration.\n\n## Related\n\n- [Removing Gemini AI Watermarks: A Deep Dive into Reverse Alpha Blending](https:\u002F\u002Fallenkuo.medium.com\u002Fremoving-gemini-ai-watermarks-a-deep-dive-into-reverse-alpha-blending-bbbd83af2a3f)\n- [SynthID Image Watermark Research Report](https:\u002F\u002Fallenkuo.medium.com\u002Fsynthid-image-watermark-research-report-9b864b19f9cf)\n- [SynthID Research Report](report\u002Fsynthid_research.md) — Why invisible watermarks cannot be removed\n- [gwt-integrations](https:\u002F\u002Fgithub.com\u002Fallenk\u002Fgwt-integrations) — Claude Code Skill + MCP Server for AI agent automation\n\n## Third-Party Licenses\n\nThis project incorporates the following open-source components:\n\n| Component | License | Usage |\n|-----------|---------|-------|\n| [NCNN](https:\u002F\u002Fgithub.com\u002FTencent\u002Fncnn) | BSD-3-Clause | Neural network inference runtime (Vulkan GPU + CPU) |\n| [FDnCNN model weights](https:\u002F\u002Fgithub.com\u002Fcszn\u002FKAIR) (KAIR) | MIT | Pre-trained denoising model (embedded FP16 weights) |\n| [volk](https:\u002F\u002Fgithub.com\u002Fzeux\u002Fvolk) | MIT | Vulkan meta-loader for dynamic dispatch |\n\nFull license texts for these components are available in their respective repositories.\n\n---\n\n\u003Cp align=\"center\">\n  \u003Ci>If this tool helped you, consider giving it a ⭐\u003C\u002Fi>\n\u003C\u002Fp>\n","Gemini Watermark Tool 是一个用于移除 Gemini 3.5 Nano Banana Pro 图像水印的维护工具。它采用数学上精确的反向Alpha混合算法来去除可见的“Gemini”水印，同时保留图像细节。该工具支持CLI和GUI两种应用形式，能够在Windows、Linux、macOS及Android平台上运行，并且集成了基于FDnCNN神经网络与Vulkan GPU加速的AI降噪功能。特别适用于需要从图片中去除特定类型水印而不损害原始内容质量的情况，比如专业摄影后期处理或版权保护场景下的水印管理。",2,"2026-06-11 03:57:30","trending"]