@pilio/gemini-watermark-remover 1.0.45 → 1.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +426 -426
  3. package/README_zh.md +415 -415
  4. package/bin/gwr.mjs +12 -12
  5. package/dist/models/allenk-fdncnn/onnx-manifest.json +49 -49
  6. package/dist/onnxruntime/LICENSE +21 -21
  7. package/dist/onnxruntime/README.md +16 -16
  8. package/dist/onnxruntime/ThirdPartyNotices.txt +6121 -6121
  9. package/dist/onnxruntime/ort-wasm-simd-threaded.asyncify.mjs +112 -112
  10. package/dist/onnxruntime/ort-wasm-simd-threaded.js +59 -59
  11. package/dist/video-app.js +1 -1
  12. package/dist/video-preview.html +599 -599
  13. package/package.json +1 -1
  14. package/skills/gemini-watermark-remover/SKILL.md +32 -32
  15. package/skills/gemini-watermark-remover/agents/openai.yaml +3 -3
  16. package/skills/gemini-watermark-remover/references/inputs-and-outputs.md +9 -9
  17. package/skills/gemini-watermark-remover/references/limitations.md +5 -5
  18. package/skills/gemini-watermark-remover/references/usage.md +23 -23
  19. package/skills/gemini-watermark-remover/scripts/run.mjs +153 -153
  20. package/src/cli/gwrCli.js +17 -17
  21. package/src/cli/gwrRemoveCommand.js +433 -433
  22. package/src/core/adaptiveDetector.js +630 -630
  23. package/src/core/allenkFdncnnDenoise.js +653 -653
  24. package/src/core/allenkFdncnnNcnnModel.js +244 -244
  25. package/src/core/allenkFdncnnOnnxExport.js +346 -346
  26. package/src/core/allenkFdncnnOnnxRuntime.js +138 -138
  27. package/src/core/allenkFdncnnReferenceRuntime.js +169 -169
  28. package/src/core/alphaGradientMask.js +165 -165
  29. package/src/core/alphaMap.js +30 -30
  30. package/src/core/blendModes.js +75 -75
  31. package/src/core/candidateEvaluation.js +299 -299
  32. package/src/core/candidateSelector.js +3736 -3736
  33. package/src/core/canvasBlob.js +26 -26
  34. package/src/core/darkOutlineContourRepair.js +323 -323
  35. package/src/core/embeddedAlphaMaps.js +102 -102
  36. package/src/core/embeddedDarkOutlineAlphaMap.js +6 -6
  37. package/src/core/embeddedOutlineAlphaMap.js +5 -5
  38. package/src/core/geminiSizeCatalog.js +580 -580
  39. package/src/core/imageWatermarkPipeline.js +329 -329
  40. package/src/core/imageWatermarkPipelineRequest.js +39 -39
  41. package/src/core/multiPassRemoval.js +93 -93
  42. package/src/core/outputResidualLocalization.js +351 -351
  43. package/src/core/pipelineAcceptedExecutor.js +364 -364
  44. package/src/core/pipelineAcceptedExecutorRequest.js +46 -46
  45. package/src/core/pipelineAcceptedFinalizationRequest.js +21 -21
  46. package/src/core/pipelineAlphaStageSpecs.js +654 -654
  47. package/src/core/pipelineAlphaTraceContract.js +58 -58
  48. package/src/core/pipelineAlphaTrial.js +306 -306
  49. package/src/core/pipelineCandidatePool.js +125 -125
  50. package/src/core/pipelineCandidateQuality.js +838 -838
  51. package/src/core/pipelineCandidateRunner.js +109 -109
  52. package/src/core/pipelineDecisionPath.js +161 -161
  53. package/src/core/pipelineDetectionCandidate.js +128 -128
  54. package/src/core/pipelineFinalization.js +99 -99
  55. package/src/core/pipelineInitialContext.js +52 -52
  56. package/src/core/pipelineInitialSelection.js +1504 -1498
  57. package/src/core/pipelineLayerContracts.js +163 -163
  58. package/src/core/pipelineMeta.js +427 -427
  59. package/src/core/pipelineMetrics.js +88 -88
  60. package/src/core/pipelinePassState.js +36 -36
  61. package/src/core/pipelineRepairGates.js +154 -154
  62. package/src/core/pipelineRepairStageSpecs.js +525 -525
  63. package/src/core/pipelineRepairTrial.js +156 -156
  64. package/src/core/pipelineResult.js +197 -197
  65. package/src/core/pipelineRuntime.js +710 -710
  66. package/src/core/pipelineRuntimeBootstrap.js +78 -78
  67. package/src/core/pipelineState.js +134 -134
  68. package/src/core/pipelineTimings.js +36 -36
  69. package/src/core/pipelineTrace.js +28 -28
  70. package/src/core/planeAlphaEvidence.js +106 -106
  71. package/src/core/previewAlphaCalibration.js +825 -825
  72. package/src/core/restorationMetrics.js +807 -807
  73. package/src/core/rowAlphaEvidence.js +59 -59
  74. package/src/core/selectionDebug.js +93 -93
  75. package/src/core/watermarkConfig.js +146 -146
  76. package/src/core/watermarkDecisionPolicy.js +163 -163
  77. package/src/core/watermarkDisplay.js +89 -89
  78. package/src/core/watermarkEngine.js +173 -173
  79. package/src/core/watermarkPresence.js +14 -14
  80. package/src/core/watermarkProcessor.js +6332 -6332
  81. package/src/core/watermarkScoring.js +197 -197
  82. package/src/core/workerClient.js +114 -114
  83. package/src/runtime/browser.d.ts +7 -7
  84. package/src/runtime/browser.js +96 -96
  85. package/src/runtime/userscript.d.ts +6 -6
  86. package/src/runtime/userscript.js +28 -28
  87. package/src/sdk/browser.d.ts +13 -13
  88. package/src/sdk/browser.js +29 -29
  89. package/src/sdk/image-data.d.ts +14 -14
  90. package/src/sdk/image-data.js +78 -78
  91. package/src/sdk/index.d.ts +191 -191
  92. package/src/sdk/index.js +8 -8
  93. package/src/sdk/node.d.ts +56 -56
  94. package/src/sdk/node.js +84 -84
  95. package/src/sdk/runtime-browser.d.ts +32 -32
  96. package/src/sdk/runtime-browser.js +1 -1
  97. package/src/sdk/runtime-userscript.d.ts +41 -41
  98. package/src/sdk/runtime-userscript.js +1 -1
  99. package/src/sdk/video.d.ts +111 -111
  100. package/src/sdk/video.js +358 -358
  101. package/src/sdk/videoProgress.js +108 -108
  102. package/src/shared/actionContextCompat.js +54 -54
  103. package/src/shared/debugFileHandoff.js +109 -109
  104. package/src/shared/domAdapter.js +279 -279
  105. package/src/shared/errorUtils.js +62 -62
  106. package/src/shared/imageProcessing.js +162 -162
  107. package/src/shared/imageSessionContext.js +98 -98
  108. package/src/shared/imageSessionStore.js +495 -495
  109. package/src/shared/originalBlob.js +79 -79
  110. package/src/shared/pageImageReplacement.js +2366 -2366
  111. package/src/userscript/actionContext.js +210 -210
  112. package/src/userscript/bridgeShared.js +72 -72
  113. package/src/userscript/clipboardHook.js +351 -351
  114. package/src/userscript/crossOriginFetch.js +84 -84
  115. package/src/userscript/downloadHook.js +1576 -1576
  116. package/src/userscript/historyBindingBootstrap.js +163 -163
  117. package/src/userscript/index.js +346 -346
  118. package/src/userscript/pageProcessBridge.js +283 -283
  119. package/src/userscript/pageProcessorRuntime.js +153 -153
  120. package/src/userscript/processBridge.js +186 -186
  121. package/src/userscript/processingRuntime.js +261 -261
  122. package/src/userscript/runtimeFlags.js +46 -46
  123. package/src/userscript/trustedTypes.js +49 -49
  124. package/src/userscript/urlUtils.js +169 -169
  125. package/src/userscript/userNotice.js +19 -19
package/README.md CHANGED
@@ -1,426 +1,426 @@
1
- [中文文档](README_zh.md)
2
-
3
- > 🔥 Tired of Gemini watermarks? Try the more powerful **GPT Image 2** at [pilio.ai](https://pilio.ai) — free for a limited time.
4
-
5
- # Gemini Watermark Remover — Lossless Watermark Removal Tool
6
-
7
- An open-source tool to **remove Gemini watermarks** from AI-generated images with high-fidelity, reproducible results on supported outputs. Built with pure JavaScript, the engine uses a mathematically exact **Reverse Alpha Blending** algorithm instead of unpredictable AI inpainting.
8
-
9
- > **🚀 Looking for the `Online Gemini Watermark Remover (Recommended)`? Try [geminiwatermarkremover.io](https://geminiwatermarkremover.io/)** — free, no install, works directly in your browser.
10
- >
11
- > 💡 Got watermarks that Gemini Watermark Remover can't handle? Try the general-purpose AI watermark remover: [pilio.ai/image-watermark-remover](https://pilio.ai/image-watermark-remover)
12
-
13
- <p align="center">
14
- <a href="https://geminiwatermarkremover.io/"><img src="https://img.shields.io/badge/🛠️_Online_Tool-geminiwatermarkremover.io-blue?style=for-the-badge" alt="Online Tool"></a>&nbsp;
15
- <a href="https://geminiwatermarkremover.io/video"><img src="https://img.shields.io/badge/🎬_Video_Remover-New!-ff6b6b?style=for-the-badge" alt="Video Watermark Remover"></a>&nbsp;
16
- <a href="https://chromewebstore.google.com/detail/gemini-watermark-remover/cjlmnfcfnofnglkphbcdclbpimdjkmdf"><img src="https://img.shields.io/badge/🧩_Chrome_Extension-Install-blueviolet?style=for-the-badge" alt="Chrome Extension"></a>&nbsp;
17
- <a href="https://geminiwatermarkremover.io/userscript/gemini-watermark-remover.user.js"><img src="https://img.shields.io/badge/🐒_Userscript-Install-green?style=for-the-badge" alt="Userscript"></a>&nbsp;
18
- <a href="https://pilio.ai/image-watermark-remover"><img src="https://img.shields.io/badge/🧹_General_Remover-pilio.ai-gray?style=for-the-badge" alt="General Watermark Remover"></a>
19
- </p>
20
-
21
- <p align="center">
22
- <img src="https://count.getloli.com/@gemini-watermark-remover?name=gemini-watermark-remover&theme=minecraft&padding=7&offset=0&align=top&scale=1&pixelated=1&darkmode=auto" width="400">
23
- </p>
24
-
25
- ## Features
26
-
27
- - ✅ **100% Local Processing** - All image processing happens locally in your browser or on your machine. Nothing is uploaded.
28
- - ✅ **Mathematical Precision** - Based on the Reverse Alpha Blending formula, not "hallucinating" AI models.
29
- - ✅ **Auto-Detection** - Automatically identifies watermark size and position using Gemini's known output catalog and local anchor search.
30
- - ✅ **Flexible Usage** - Online tool for quick use, Chrome extension or userscript for seamless Gemini page integration, CLI and Skill for scripting and automation.
31
- - ✅ **Video Support** - Remove watermarks from Gemini-generated videos at [geminiwatermarkremover.io/video](https://geminiwatermarkremover.io/video).
32
- - ✅ **Cross-Platform** - Works in modern browsers (Chrome, Firefox, Safari, Edge) and Node.js environments.
33
-
34
- ## Gemini Watermark Removal Examples
35
-
36
- <details open>
37
- <summary>Click to Expand/Collapse Examples</summary>
38
-
39
- | Original Image | Watermark Removed |
40
- | :---: | :----: |
41
- | <img src="docs/demo-before.webp" width="400"> | <img src="docs/demo-after.webp" width="400"> |
42
-
43
- </details>
44
-
45
- ## ⚠️ Disclaimer
46
-
47
- > [!WARNING]
48
- > **USE AT YOUR OWN RISK**
49
- >
50
- > This tool modifies image files. While it is designed to work reliably, unexpected results may occur due to:
51
- > - Variations in Gemini's watermark implementation
52
- > - Corrupted or unusual image formats
53
- > - Edge cases not covered by testing
54
- >
55
- > 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.
56
-
57
- > [!NOTE]
58
- > **Note**: Disable any fingerprint defender extensions (e.g., Canvas Fingerprint Defender) to avoid processing errors. https://github.com/GargantuaX/gemini-watermark-remover/issues/3
59
-
60
- ## How to Remove Gemini Watermarks
61
-
62
- ### Online Gemini Watermark Remover (Recommended)
63
-
64
- For all users — the fastest and easiest way to remove Gemini watermarks from images:
65
-
66
- 1. Open **[geminiwatermarkremover.io](https://geminiwatermarkremover.io/)**.
67
- 2. Drag and drop or click to select your Gemini-generated image.
68
- 3. The engine will automatically process and remove the watermark.
69
- 4. Download the cleaned image.
70
-
71
- ### Online Video Watermark Remover (New!)
72
-
73
- For Gemini-generated **videos** with visible watermarks:
74
-
75
- 1. Open **[geminiwatermarkremover.io/video](https://geminiwatermarkremover.io/video)**.
76
- 2. Upload or drag-and-drop your Gemini-generated video.
77
- 3. The tool will automatically detect and remove the watermark from the video.
78
- 4. Download the cleaned video.
79
-
80
- > **Note**: Video watermark removal runs entirely in your browser — no files are uploaded to any server.
81
-
82
- ### Chrome Extension
83
-
84
- Use this if you do not want a userscript manager but still want automatic Gemini page integration for previews, copy, and download actions.
85
-
86
- 1. Open [Gemini Watermark Remover on the Chrome Web Store](https://chromewebstore.google.com/detail/gemini-watermark-remover/cjlmnfcfnofnglkphbcdclbpimdjkmdf).
87
- 2. Click **Add to Chrome** and confirm the install.
88
- 3. Open Gemini. The extension will automatically process supported Gemini images.
89
-
90
- The popup includes an "Enable on Gemini" toggle. If Gemini becomes slow, behaves unexpectedly, or you need to troubleshoot the page, turn the toggle off and refresh Gemini.
91
-
92
- Chrome Web Store installs update automatically. If the Web Store is not reachable in your network, the matching verified zip (`gemini-watermark-remover-extension-v*.zip`) remains available from [GitHub Releases](https://github.com/GargantuaX/gemini-watermark-remover/releases/latest) and the official website download entry for manual unpacked installation.
93
-
94
- ### Userscript
95
-
96
- 1. Install a userscript manager (e.g., Tampermonkey or Greasemonkey).
97
- 2. Open [gemini-watermark-remover.user.js](https://geminiwatermarkremover.io/userscript/gemini-watermark-remover.user.js).
98
- 3. The script will install automatically.
99
- 4. Navigate to Gemini conversation pages.
100
- 5. Eligible Gemini preview images on the page are replaced in place after processing.
101
- 6. Gemini's native "Copy Image" and "Download Image" actions also return processed results.
102
-
103
- Current userscript boundaries:
104
-
105
- - no injected per-image controls
106
- - no popup UI or bulk action surface
107
- - page previews and native copy/download flows are both processed when the source image is reachable
108
- - preview images keep the original visible while processing, with a subdued `Processing...` overlay
109
- - if preview processing fails, the original page image stays visible and usable
110
-
111
- ### Skill
112
-
113
- For workflows that involve AI coding agents:
114
-
115
- - `skills/gemini-watermark-remover/` contains a packaged Skill that agents can discover and invoke.
116
- - Install it with `skills.sh` using:
117
-
118
- ```bash
119
- pnpm dlx skills add GargantuaX/gemini-watermark-remover --skill gemini-watermark-remover
120
- ```
121
-
122
- - Add flags like `--agent`, `--yes`, or `--copy` only if your local setup needs them.
123
- - Usage:
124
-
125
- ```bash
126
- node skills/gemini-watermark-remover/scripts/run.mjs remove <input> --output <file>
127
- ```
128
-
129
- - See [`SKILL.md`](skills/gemini-watermark-remover/SKILL.md) for agent integration details.
130
-
131
- ### CLI
132
-
133
- For scripting, CI, and local batch workflows, use the direct CLI:
134
-
135
- ```bash
136
- # repo-local
137
- node bin/gwr.mjs remove <input> --output <file>
138
-
139
- # installed globally
140
- gwr remove <input> [--output <file> | --out-dir <dir>] [--overwrite] [--json]
141
- ```
142
-
143
- Video exports default to the repository's calibrated 12 Mbps AVC profile. For a
144
- quality-sensitive source, request a higher encoder target explicitly:
145
-
146
- ```bash
147
- gwr remove input.mp4 --output clean.mp4 --video-bitrate-mbps 20
148
- ```
149
-
150
- The CLI reports video frame progress on stderr. `--video-timeout-ms` is an
151
- inactivity timeout: an export may run longer than that value as long as frames
152
- continue to advance.
153
-
154
- If you do not have `gwr` installed globally, use:
155
-
156
- ```bash
157
- pnpm dlx @pilio/gemini-watermark-remover remove <input> --output <file>
158
- ```
159
-
160
- The default CLI file decoder/encoder uses `sharp`. SDK consumers that only use browser or `ImageData` APIs do not need it. If you use the CLI file path in your own project, install `sharp` alongside this package:
161
-
162
- ```bash
163
- pnpm add sharp
164
- ```
165
-
166
- ### Can't Remove Your Watermark?
167
-
168
- This tool targets Gemini's visible watermark (the semi-transparent logo in the bottom-right corner). If your image watermark doesn't match a known Gemini format, or you need to remove other types of image watermarks, try the general-purpose AI watermark remover:
169
-
170
- 👉 **[pilio.ai/image-watermark-remover](https://pilio.ai/image-watermark-remover)**
171
-
172
- ### Developer Preview
173
-
174
- The repository still keeps a local internal preview harness at `/dev-preview.html` for single-image comparison, copy, and download verification.
175
-
176
- - This is a retained internal debugging surface, not the public product website.
177
- - The root path `/` now only redirects users toward the official website, the userscript artifact, and the internal preview page.
178
- - Public-facing usage should prefer the official website or the userscript instead of this local preview harness.
179
-
180
- ## Development
181
-
182
- ```bash
183
- # Install dependencies
184
- pnpm install
185
-
186
- # Development build
187
- pnpm dev
188
-
189
- # Production build
190
- pnpm build
191
-
192
- # Local static serving
193
- pnpm serve
194
- ```
195
-
196
- Notes:
197
-
198
- - The root path `/` is now a lightweight entry page that points to the official website, the userscript artifact, and the retained internal preview page.
199
- - The internal browser preview harness lives at `/dev-preview.html`, is now kept as a static Chinese-only single-image compare harness for local algorithm/UI debugging, and no longer maintains public-facing locale or theme-switching features.
200
- - `pnpm dev` / `pnpm serve` still host the userscript, probe pages, and these static assets.
201
- - For GitHub issues with Release-hosted samples, `pnpm issue:verify -- --issue <number>` reuses the `gh` login, caches and verifies the samples, and generates a reviewable comment draft. See [GitHub issue sample verification](docs/github-issue-verification.zh.md).
202
-
203
- ### Tampermonkey Debugging on macOS
204
-
205
- For the repo's fixed-profile workflow on macOS:
206
-
207
- ```bash
208
- # Build the latest userscript
209
- pnpm build
210
-
211
- # Start a local dist server if needed
212
- pnpm dev
213
-
214
- # Open the fixed Chrome profile with remote debugging enabled
215
- ./scripts/open-fixed-chrome-profile.sh --url https://gemini.google.com/app
216
- ```
217
-
218
- Notes:
219
-
220
- - the fixed profile lives under `.chrome-debug/tampermonkey-profile`
221
- - default CDP port is `9226`
222
- - default proxy is `http://127.0.0.1:7890`; disable it with `--proxy off` if not needed
223
- - reinstall the latest userscript from the active local `pnpm dev` server
224
- - `pnpm dev` starts probing from `http://127.0.0.1:4173/` and auto-increments if that port is already occupied
225
- - if you are following a previously captured debugging session, its port may differ; trust the current `pnpm dev` output instead of hardcoding `4173`
226
-
227
- ## SDK Usage (Advanced / Internal)
228
-
229
- The package root still exposes an SDK, but this path is intended for advanced or internal integration scenarios:
230
-
231
- ```javascript
232
- import {
233
- createWatermarkEngine,
234
- removeWatermarkFromImage,
235
- removeWatermarkFromImageData,
236
- removeWatermarkFromImageDataSync,
237
- } from '@pilio/gemini-watermark-remover';
238
- ```
239
-
240
- Use the pure-data API when you already have decoded `ImageData`:
241
-
242
- ```javascript
243
- const result = await removeWatermarkFromImageData(imageData, {
244
- adaptiveMode: 'auto',
245
- });
246
-
247
- console.log(result.meta.decisionTier);
248
- ```
249
-
250
- Use the browser image API when you have an `HTMLImageElement` or `HTMLCanvasElement`:
251
-
252
- ```javascript
253
- const { canvas, meta } = await removeWatermarkFromImage(imageElement);
254
- document.body.append(canvas);
255
- console.log(meta.applied, meta.decisionTier);
256
- ```
257
-
258
- If you need to process many images, reuse a single engine instance so alpha maps stay cached:
259
-
260
- ```javascript
261
- const engine = await createWatermarkEngine();
262
- const first = await removeWatermarkFromImageData(imageDataA, { engine });
263
- const second = await removeWatermarkFromImageData(imageDataB, { engine });
264
- ```
265
-
266
- For Node.js integrations, use the dedicated subpath and inject your own decoder/encoder:
267
-
268
- ```javascript
269
- import { removeWatermarkFromBuffer } from '@pilio/gemini-watermark-remover/node';
270
-
271
- const result = await removeWatermarkFromBuffer(inputBuffer, {
272
- mimeType: 'image/png',
273
- decodeImageData: yourDecodeFn,
274
- encodeImageData: yourEncodeFn,
275
- });
276
- ```
277
-
278
- ## Runtime Requirements
279
-
280
- ### Web And Userscript
281
-
282
- - modern Chrome / Firefox / Safari / Edge class browser
283
- - ES modules
284
- - Canvas API
285
- - Async/Await
286
- - TypedArray (`Float32Array`, `Uint8ClampedArray`)
287
- - for the website copy button: `navigator.clipboard.write(...)` and `ClipboardItem`
288
-
289
- ### CLI And Skill
290
-
291
- - a local Node.js runtime capable of running this package
292
- - `sharp` installed when using the default CLI file decoder/encoder
293
- - filesystem access for local input/output paths
294
- - for repo-local usage:
295
-
296
- ```bash
297
- node bin/gwr.mjs remove <input> --output <file>
298
- node skills/gemini-watermark-remover/scripts/run.mjs remove <input> --output <file>
299
- ```
300
-
301
- - for distributed Skill usage, the local environment must be able to execute the packaged `gwr` CLI boundary
302
-
303
- ## Testing
304
-
305
- ```bash
306
- # Run all tests
307
- pnpm test
308
- ```
309
-
310
- Regression tests include image fixtures from `src/assets/samples/`.
311
- Source samples stay in git.
312
- Naming and retention rules for those fixtures are documented in `src/assets/samples/README.md`.
313
- Complex preview/download validation notes are documented in `docs/complex-figure-verification-checklist.md`.
314
- Local files under `src/assets/samples/fix/` are optional snapshot outputs for manual regression checks and are intentionally not tracked by git.
315
-
316
- ## Release Notes
317
-
318
- See [CHANGELOG.md](CHANGELOG.md) for release history and [RELEASE.md](RELEASE.md) for the local release checklist. The latest post-release closeout is documented in [docs/release-1.0.29-post-release.md](docs/release-1.0.29-post-release.md).
319
-
320
- ## How Gemini Watermark Removal Works
321
-
322
- ### The Gemini Watermarking Process
323
-
324
- Gemini applies watermarks using standard alpha compositing:
325
-
326
- $$watermarked = \alpha \cdot logo + (1 - \alpha) \cdot original$$
327
-
328
- Where:
329
- - `watermarked`: The pixel value with the watermark.
330
- - `α`: The Alpha channel value (0.0 - 1.0).
331
- - `logo`: The watermark logo color value (White = 255).
332
- - `original`: The raw, original pixel value we want to recover.
333
-
334
- ### The Reverse Solution
335
-
336
- To remove the watermark, we solve for `original`:
337
-
338
- $$original = \frac{watermarked - \alpha \cdot logo}{1 - \alpha}$$
339
-
340
- By capturing the watermark on a known solid background, we reconstruct the exact Alpha map and apply the inverse formula to restore the original pixels with zero loss.
341
-
342
- ## Detection Rules
343
-
344
- The engine uses layered detection to locate and verify watermarks:
345
-
346
- 1. **Size catalog lookup** — matches image dimensions against Gemini's known output sizes to predict watermark size and position.
347
- 2. **Local anchor search** — refines the predicted position by scanning pixel data around the expected watermark region.
348
- 3. **Restoration validation** — confirms the detected watermark is real before applying removal, avoiding false positives.
349
-
350
- Default watermark configurations:
351
-
352
- | Condition | Watermark Size | Right Margin | Bottom Margin |
353
- | :--- | :--- | :--- | :--- |
354
- | Larger Gemini outputs | 96×96 | 64px | 64px |
355
- | Smaller Gemini outputs | 48×48 | 32px | 32px |
356
-
357
- ## Project Structure
358
-
359
- ```text
360
- gemini-watermark-remover/
361
- ├── bin/ # Published CLI entrypoint (`gwr`)
362
- ├── public/
363
- │ ├── index.html # Entry page for official site / userscript / internal preview
364
- │ ├── dev-preview.html # Internal browser preview harness kept for local debugging
365
- │ └── tampermonkey-worker-probe.* # Probe pages for userscript/debug flows
366
- ├── skills/
367
- │ └── gemini-watermark-remover/ # Distributable agent skill bundle
368
- ├── src/
369
- │ ├── assets/ # Calibration assets and regression samples
370
- │ ├── cli/ # CLI argument parsing and file workflows
371
- │ ├── core/ # Watermark math, scoring, and restoration
372
- │ ├── page/ # Page-side runtime for Gemini page integration
373
- │ ├── sdk/ # Advanced/internal SDK surface
374
- │ ├── shared/ # Shared DOM, blob, and session helpers
375
- │ ├── userscript/ # Userscript entrypoints and browser hooks
376
- │ ├── workers/ # Worker runtime
377
- │ ├── app.js # Internal single-image preview harness entry point
378
- │ └── utils.js # Shared browser helpers for the internal preview page
379
- ├── tests/ # Unit, regression, packaging, and smoke tests
380
- ├── scripts/ # Local automation and debug launchers
381
- ├── dist/ # Build output directory
382
- ├── build.js # Build script
383
- └── package.json
384
- ```
385
-
386
- ## Architecture Overview
387
-
388
- - `src/core/` contains watermark detection, candidate selection, restoration metrics, and the reverse-alpha removal pipeline.
389
- - `src/userscript/`, `src/page/`, and `src/shared/` implement the real Gemini page integration, including preview replacement plus copy/download interception.
390
- - `src/cli/` and `bin/gwr.mjs` expose file-oriented local automation.
391
- - `skills/gemini-watermark-remover/` provides a distributable Skill that stays on the CLI boundary instead of importing repository internals directly.
392
- - `src/sdk/` remains available for advanced/internal integrations, but it is no longer the primary public entrypoint.
393
-
394
- ---
395
-
396
- ## Limitations
397
-
398
- - Only removes **Gemini visible watermarks** <small>(the semi-transparent logo in bottom-right)</small>
399
- - Supports both **image** and **video** watermark removal — video processing is available via the [online tool](https://geminiwatermarkremover.io/video)
400
- - Does not remove invisible/steganographic watermarks. <small>[(Learn more about SynthID)](https://support.google.com/gemini/answer/16722517)</small>
401
- - Designed for Gemini's current visible watermark pattern <small>(validated against this repo through April 2026)</small>
402
-
403
- ## Legal Disclaimer
404
-
405
- This project is released under the **MIT License**.
406
-
407
- The 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.
408
-
409
- The author does not condone or encourage the misuse of this tool for copyright infringement, misrepresentation, or any other unlawful purposes.
410
-
411
- **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.**
412
-
413
- ## Credits
414
-
415
- This project is a JavaScript port of the [Gemini Watermark Tool](https://github.com/allenk/GeminiWatermarkTool) by Allen Kuo ([@allenk](https://github.com/allenk)).
416
-
417
- The Reverse Alpha Blending method and calibrated watermark masks are based on the original work © 2024 AllenK (Kwyshell), licensed under MIT License.
418
-
419
- ## Related Links
420
-
421
- - [Gemini Watermark Tool](https://github.com/allenk/GeminiWatermarkTool)
422
- - [Removing Gemini AI Watermarks: A Deep Dive into Reverse Alpha Blending](https://allenkuo.medium.com/removing-gemini-ai-watermarks-a-deep-dive-into-reverse-alpha-blending-bbbd83af2a3f)
423
-
424
- ## License
425
-
426
- [MIT License](./LICENSE)
1
+ [中文文档](README_zh.md)
2
+
3
+ > 🔥 Tired of Gemini watermarks? Try the more powerful **GPT Image 2** at [pilio.ai](https://pilio.ai) — free for a limited time.
4
+
5
+ # Gemini Watermark Remover — Lossless Watermark Removal Tool
6
+
7
+ An open-source tool to **remove Gemini watermarks** from AI-generated images with high-fidelity, reproducible results on supported outputs. Built with pure JavaScript, the engine uses a mathematically exact **Reverse Alpha Blending** algorithm instead of unpredictable AI inpainting.
8
+
9
+ > **🚀 Looking for the `Online Gemini Watermark Remover (Recommended)`? Try [geminiwatermarkremover.io](https://geminiwatermarkremover.io/)** — free, no install, works directly in your browser.
10
+ >
11
+ > 💡 Got watermarks that Gemini Watermark Remover can't handle? Try the general-purpose AI watermark remover: [pilio.ai/image-watermark-remover](https://pilio.ai/image-watermark-remover)
12
+
13
+ <p align="center">
14
+ <a href="https://geminiwatermarkremover.io/"><img src="https://img.shields.io/badge/🛠️_Online_Tool-geminiwatermarkremover.io-blue?style=for-the-badge" alt="Online Tool"></a>&nbsp;
15
+ <a href="https://geminiwatermarkremover.io/video"><img src="https://img.shields.io/badge/🎬_Video_Remover-New!-ff6b6b?style=for-the-badge" alt="Video Watermark Remover"></a>&nbsp;
16
+ <a href="https://chromewebstore.google.com/detail/gemini-watermark-remover/cjlmnfcfnofnglkphbcdclbpimdjkmdf"><img src="https://img.shields.io/badge/🧩_Chrome_Extension-Install-blueviolet?style=for-the-badge" alt="Chrome Extension"></a>&nbsp;
17
+ <a href="https://geminiwatermarkremover.io/userscript/gemini-watermark-remover.user.js"><img src="https://img.shields.io/badge/🐒_Userscript-Install-green?style=for-the-badge" alt="Userscript"></a>&nbsp;
18
+ <a href="https://pilio.ai/image-watermark-remover"><img src="https://img.shields.io/badge/🧹_General_Remover-pilio.ai-gray?style=for-the-badge" alt="General Watermark Remover"></a>
19
+ </p>
20
+
21
+ <p align="center">
22
+ <img src="https://count.getloli.com/@gemini-watermark-remover?name=gemini-watermark-remover&theme=minecraft&padding=7&offset=0&align=top&scale=1&pixelated=1&darkmode=auto" width="400">
23
+ </p>
24
+
25
+ ## Features
26
+
27
+ - ✅ **100% Local Processing** - All image processing happens locally in your browser or on your machine. Nothing is uploaded.
28
+ - ✅ **Mathematical Precision** - Based on the Reverse Alpha Blending formula, not "hallucinating" AI models.
29
+ - ✅ **Auto-Detection** - Automatically identifies watermark size and position using Gemini's known output catalog and local anchor search.
30
+ - ✅ **Flexible Usage** - Online tool for quick use, Chrome extension or userscript for seamless Gemini page integration, CLI and Skill for scripting and automation.
31
+ - ✅ **Video Support** - Remove watermarks from Gemini-generated videos at [geminiwatermarkremover.io/video](https://geminiwatermarkremover.io/video).
32
+ - ✅ **Cross-Platform** - Works in modern browsers (Chrome, Firefox, Safari, Edge) and Node.js environments.
33
+
34
+ ## Gemini Watermark Removal Examples
35
+
36
+ <details open>
37
+ <summary>Click to Expand/Collapse Examples</summary>
38
+
39
+ | Original Image | Watermark Removed |
40
+ | :---: | :----: |
41
+ | <img src="docs/demo-before.webp" width="400"> | <img src="docs/demo-after.webp" width="400"> |
42
+
43
+ </details>
44
+
45
+ ## ⚠️ Disclaimer
46
+
47
+ > [!WARNING]
48
+ > **USE AT YOUR OWN RISK**
49
+ >
50
+ > This tool modifies image files. While it is designed to work reliably, unexpected results may occur due to:
51
+ > - Variations in Gemini's watermark implementation
52
+ > - Corrupted or unusual image formats
53
+ > - Edge cases not covered by testing
54
+ >
55
+ > 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.
56
+
57
+ > [!NOTE]
58
+ > **Note**: Disable any fingerprint defender extensions (e.g., Canvas Fingerprint Defender) to avoid processing errors. https://github.com/GargantuaX/gemini-watermark-remover/issues/3
59
+
60
+ ## How to Remove Gemini Watermarks
61
+
62
+ ### Online Gemini Watermark Remover (Recommended)
63
+
64
+ For all users — the fastest and easiest way to remove Gemini watermarks from images:
65
+
66
+ 1. Open **[geminiwatermarkremover.io](https://geminiwatermarkremover.io/)**.
67
+ 2. Drag and drop or click to select your Gemini-generated image.
68
+ 3. The engine will automatically process and remove the watermark.
69
+ 4. Download the cleaned image.
70
+
71
+ ### Online Video Watermark Remover (New!)
72
+
73
+ For Gemini-generated **videos** with visible watermarks:
74
+
75
+ 1. Open **[geminiwatermarkremover.io/video](https://geminiwatermarkremover.io/video)**.
76
+ 2. Upload or drag-and-drop your Gemini-generated video.
77
+ 3. The tool will automatically detect and remove the watermark from the video.
78
+ 4. Download the cleaned video.
79
+
80
+ > **Note**: Video watermark removal runs entirely in your browser — no files are uploaded to any server.
81
+
82
+ ### Chrome Extension
83
+
84
+ Use this if you do not want a userscript manager but still want automatic Gemini page integration for previews, copy, and download actions.
85
+
86
+ 1. Open [Gemini Watermark Remover on the Chrome Web Store](https://chromewebstore.google.com/detail/gemini-watermark-remover/cjlmnfcfnofnglkphbcdclbpimdjkmdf).
87
+ 2. Click **Add to Chrome** and confirm the install.
88
+ 3. Open Gemini. The extension will automatically process supported Gemini images.
89
+
90
+ The popup includes an "Enable on Gemini" toggle. If Gemini becomes slow, behaves unexpectedly, or you need to troubleshoot the page, turn the toggle off and refresh Gemini.
91
+
92
+ Chrome Web Store installs update automatically. If the Web Store is not reachable in your network, the matching verified zip (`gemini-watermark-remover-extension-v*.zip`) remains available from [GitHub Releases](https://github.com/GargantuaX/gemini-watermark-remover/releases/latest) and the official website download entry for manual unpacked installation.
93
+
94
+ ### Userscript
95
+
96
+ 1. Install a userscript manager (e.g., Tampermonkey or Greasemonkey).
97
+ 2. Open [gemini-watermark-remover.user.js](https://geminiwatermarkremover.io/userscript/gemini-watermark-remover.user.js).
98
+ 3. The script will install automatically.
99
+ 4. Navigate to Gemini conversation pages.
100
+ 5. Eligible Gemini preview images on the page are replaced in place after processing.
101
+ 6. Gemini's native "Copy Image" and "Download Image" actions also return processed results.
102
+
103
+ Current userscript boundaries:
104
+
105
+ - no injected per-image controls
106
+ - no popup UI or bulk action surface
107
+ - page previews and native copy/download flows are both processed when the source image is reachable
108
+ - preview images keep the original visible while processing, with a subdued `Processing...` overlay
109
+ - if preview processing fails, the original page image stays visible and usable
110
+
111
+ ### Skill
112
+
113
+ For workflows that involve AI coding agents:
114
+
115
+ - `skills/gemini-watermark-remover/` contains a packaged Skill that agents can discover and invoke.
116
+ - Install it with `skills.sh` using:
117
+
118
+ ```bash
119
+ pnpm dlx skills add GargantuaX/gemini-watermark-remover --skill gemini-watermark-remover
120
+ ```
121
+
122
+ - Add flags like `--agent`, `--yes`, or `--copy` only if your local setup needs them.
123
+ - Usage:
124
+
125
+ ```bash
126
+ node skills/gemini-watermark-remover/scripts/run.mjs remove <input> --output <file>
127
+ ```
128
+
129
+ - See [`SKILL.md`](skills/gemini-watermark-remover/SKILL.md) for agent integration details.
130
+
131
+ ### CLI
132
+
133
+ For scripting, CI, and local batch workflows, use the direct CLI:
134
+
135
+ ```bash
136
+ # repo-local
137
+ node bin/gwr.mjs remove <input> --output <file>
138
+
139
+ # installed globally
140
+ gwr remove <input> [--output <file> | --out-dir <dir>] [--overwrite] [--json]
141
+ ```
142
+
143
+ Video exports default to the repository's calibrated 12 Mbps AVC profile. For a
144
+ quality-sensitive source, request a higher encoder target explicitly:
145
+
146
+ ```bash
147
+ gwr remove input.mp4 --output clean.mp4 --video-bitrate-mbps 20
148
+ ```
149
+
150
+ The CLI reports video frame progress on stderr. `--video-timeout-ms` is an
151
+ inactivity timeout: an export may run longer than that value as long as frames
152
+ continue to advance.
153
+
154
+ If you do not have `gwr` installed globally, use:
155
+
156
+ ```bash
157
+ pnpm dlx @pilio/gemini-watermark-remover remove <input> --output <file>
158
+ ```
159
+
160
+ The default CLI file decoder/encoder uses `sharp`. SDK consumers that only use browser or `ImageData` APIs do not need it. If you use the CLI file path in your own project, install `sharp` alongside this package:
161
+
162
+ ```bash
163
+ pnpm add sharp
164
+ ```
165
+
166
+ ### Can't Remove Your Watermark?
167
+
168
+ This tool targets Gemini's visible watermark (the semi-transparent logo in the bottom-right corner). If your image watermark doesn't match a known Gemini format, or you need to remove other types of image watermarks, try the general-purpose AI watermark remover:
169
+
170
+ 👉 **[pilio.ai/image-watermark-remover](https://pilio.ai/image-watermark-remover)**
171
+
172
+ ### Developer Preview
173
+
174
+ The repository still keeps a local internal preview harness at `/dev-preview.html` for single-image comparison, copy, and download verification.
175
+
176
+ - This is a retained internal debugging surface, not the public product website.
177
+ - The root path `/` now only redirects users toward the official website, the userscript artifact, and the internal preview page.
178
+ - Public-facing usage should prefer the official website or the userscript instead of this local preview harness.
179
+
180
+ ## Development
181
+
182
+ ```bash
183
+ # Install dependencies
184
+ pnpm install
185
+
186
+ # Development build
187
+ pnpm dev
188
+
189
+ # Production build
190
+ pnpm build
191
+
192
+ # Local static serving
193
+ pnpm serve
194
+ ```
195
+
196
+ Notes:
197
+
198
+ - The root path `/` is now a lightweight entry page that points to the official website, the userscript artifact, and the retained internal preview page.
199
+ - The internal browser preview harness lives at `/dev-preview.html`, is now kept as a static Chinese-only single-image compare harness for local algorithm/UI debugging, and no longer maintains public-facing locale or theme-switching features.
200
+ - `pnpm dev` / `pnpm serve` still host the userscript, probe pages, and these static assets.
201
+ - For GitHub issues with Release-hosted samples, `pnpm issue:verify -- --issue <number>` reuses the `gh` login, caches and verifies the samples, and generates a reviewable comment draft. See [GitHub issue sample verification](docs/github-issue-verification.zh.md).
202
+
203
+ ### Tampermonkey Debugging on macOS
204
+
205
+ For the repo's fixed-profile workflow on macOS:
206
+
207
+ ```bash
208
+ # Build the latest userscript
209
+ pnpm build
210
+
211
+ # Start a local dist server if needed
212
+ pnpm dev
213
+
214
+ # Open the fixed Chrome profile with remote debugging enabled
215
+ ./scripts/open-fixed-chrome-profile.sh --url https://gemini.google.com/app
216
+ ```
217
+
218
+ Notes:
219
+
220
+ - the fixed profile lives under `.chrome-debug/tampermonkey-profile`
221
+ - default CDP port is `9226`
222
+ - default proxy is `http://127.0.0.1:7890`; disable it with `--proxy off` if not needed
223
+ - reinstall the latest userscript from the active local `pnpm dev` server
224
+ - `pnpm dev` starts probing from `http://127.0.0.1:4173/` and auto-increments if that port is already occupied
225
+ - if you are following a previously captured debugging session, its port may differ; trust the current `pnpm dev` output instead of hardcoding `4173`
226
+
227
+ ## SDK Usage (Advanced / Internal)
228
+
229
+ The package root still exposes an SDK, but this path is intended for advanced or internal integration scenarios:
230
+
231
+ ```javascript
232
+ import {
233
+ createWatermarkEngine,
234
+ removeWatermarkFromImage,
235
+ removeWatermarkFromImageData,
236
+ removeWatermarkFromImageDataSync,
237
+ } from '@pilio/gemini-watermark-remover';
238
+ ```
239
+
240
+ Use the pure-data API when you already have decoded `ImageData`:
241
+
242
+ ```javascript
243
+ const result = await removeWatermarkFromImageData(imageData, {
244
+ adaptiveMode: 'auto',
245
+ });
246
+
247
+ console.log(result.meta.decisionTier);
248
+ ```
249
+
250
+ Use the browser image API when you have an `HTMLImageElement` or `HTMLCanvasElement`:
251
+
252
+ ```javascript
253
+ const { canvas, meta } = await removeWatermarkFromImage(imageElement);
254
+ document.body.append(canvas);
255
+ console.log(meta.applied, meta.decisionTier);
256
+ ```
257
+
258
+ If you need to process many images, reuse a single engine instance so alpha maps stay cached:
259
+
260
+ ```javascript
261
+ const engine = await createWatermarkEngine();
262
+ const first = await removeWatermarkFromImageData(imageDataA, { engine });
263
+ const second = await removeWatermarkFromImageData(imageDataB, { engine });
264
+ ```
265
+
266
+ For Node.js integrations, use the dedicated subpath and inject your own decoder/encoder:
267
+
268
+ ```javascript
269
+ import { removeWatermarkFromBuffer } from '@pilio/gemini-watermark-remover/node';
270
+
271
+ const result = await removeWatermarkFromBuffer(inputBuffer, {
272
+ mimeType: 'image/png',
273
+ decodeImageData: yourDecodeFn,
274
+ encodeImageData: yourEncodeFn,
275
+ });
276
+ ```
277
+
278
+ ## Runtime Requirements
279
+
280
+ ### Web And Userscript
281
+
282
+ - modern Chrome / Firefox / Safari / Edge class browser
283
+ - ES modules
284
+ - Canvas API
285
+ - Async/Await
286
+ - TypedArray (`Float32Array`, `Uint8ClampedArray`)
287
+ - for the website copy button: `navigator.clipboard.write(...)` and `ClipboardItem`
288
+
289
+ ### CLI And Skill
290
+
291
+ - a local Node.js runtime capable of running this package
292
+ - `sharp` installed when using the default CLI file decoder/encoder
293
+ - filesystem access for local input/output paths
294
+ - for repo-local usage:
295
+
296
+ ```bash
297
+ node bin/gwr.mjs remove <input> --output <file>
298
+ node skills/gemini-watermark-remover/scripts/run.mjs remove <input> --output <file>
299
+ ```
300
+
301
+ - for distributed Skill usage, the local environment must be able to execute the packaged `gwr` CLI boundary
302
+
303
+ ## Testing
304
+
305
+ ```bash
306
+ # Run all tests
307
+ pnpm test
308
+ ```
309
+
310
+ Regression tests include image fixtures from `src/assets/samples/`.
311
+ Source samples stay in git.
312
+ Naming and retention rules for those fixtures are documented in `src/assets/samples/README.md`.
313
+ Complex preview/download validation notes are documented in `docs/complex-figure-verification-checklist.md`.
314
+ Local files under `src/assets/samples/fix/` are optional snapshot outputs for manual regression checks and are intentionally not tracked by git.
315
+
316
+ ## Release Notes
317
+
318
+ See [CHANGELOG.md](CHANGELOG.md) for release history and [RELEASE.md](RELEASE.md) for the local release checklist. The latest post-release closeout is documented in [docs/release-1.0.29-post-release.md](docs/release-1.0.29-post-release.md).
319
+
320
+ ## How Gemini Watermark Removal Works
321
+
322
+ ### The Gemini Watermarking Process
323
+
324
+ Gemini applies watermarks using standard alpha compositing:
325
+
326
+ $$watermarked = \alpha \cdot logo + (1 - \alpha) \cdot original$$
327
+
328
+ Where:
329
+ - `watermarked`: The pixel value with the watermark.
330
+ - `α`: The Alpha channel value (0.0 - 1.0).
331
+ - `logo`: The watermark logo color value (White = 255).
332
+ - `original`: The raw, original pixel value we want to recover.
333
+
334
+ ### The Reverse Solution
335
+
336
+ To remove the watermark, we solve for `original`:
337
+
338
+ $$original = \frac{watermarked - \alpha \cdot logo}{1 - \alpha}$$
339
+
340
+ By capturing the watermark on a known solid background, we reconstruct the exact Alpha map and apply the inverse formula to restore the original pixels with zero loss.
341
+
342
+ ## Detection Rules
343
+
344
+ The engine uses layered detection to locate and verify watermarks:
345
+
346
+ 1. **Size catalog lookup** — matches image dimensions against Gemini's known output sizes to predict watermark size and position.
347
+ 2. **Local anchor search** — refines the predicted position by scanning pixel data around the expected watermark region.
348
+ 3. **Restoration validation** — confirms the detected watermark is real before applying removal, avoiding false positives.
349
+
350
+ Default watermark configurations:
351
+
352
+ | Condition | Watermark Size | Right Margin | Bottom Margin |
353
+ | :--- | :--- | :--- | :--- |
354
+ | Larger Gemini outputs | 96×96 | 64px | 64px |
355
+ | Smaller Gemini outputs | 48×48 | 32px | 32px |
356
+
357
+ ## Project Structure
358
+
359
+ ```text
360
+ gemini-watermark-remover/
361
+ ├── bin/ # Published CLI entrypoint (`gwr`)
362
+ ├── public/
363
+ │ ├── index.html # Entry page for official site / userscript / internal preview
364
+ │ ├── dev-preview.html # Internal browser preview harness kept for local debugging
365
+ │ └── tampermonkey-worker-probe.* # Probe pages for userscript/debug flows
366
+ ├── skills/
367
+ │ └── gemini-watermark-remover/ # Distributable agent skill bundle
368
+ ├── src/
369
+ │ ├── assets/ # Calibration assets and regression samples
370
+ │ ├── cli/ # CLI argument parsing and file workflows
371
+ │ ├── core/ # Watermark math, scoring, and restoration
372
+ │ ├── page/ # Page-side runtime for Gemini page integration
373
+ │ ├── sdk/ # Advanced/internal SDK surface
374
+ │ ├── shared/ # Shared DOM, blob, and session helpers
375
+ │ ├── userscript/ # Userscript entrypoints and browser hooks
376
+ │ ├── workers/ # Worker runtime
377
+ │ ├── app.js # Internal single-image preview harness entry point
378
+ │ └── utils.js # Shared browser helpers for the internal preview page
379
+ ├── tests/ # Unit, regression, packaging, and smoke tests
380
+ ├── scripts/ # Local automation and debug launchers
381
+ ├── dist/ # Build output directory
382
+ ├── build.js # Build script
383
+ └── package.json
384
+ ```
385
+
386
+ ## Architecture Overview
387
+
388
+ - `src/core/` contains watermark detection, candidate selection, restoration metrics, and the reverse-alpha removal pipeline.
389
+ - `src/userscript/`, `src/page/`, and `src/shared/` implement the real Gemini page integration, including preview replacement plus copy/download interception.
390
+ - `src/cli/` and `bin/gwr.mjs` expose file-oriented local automation.
391
+ - `skills/gemini-watermark-remover/` provides a distributable Skill that stays on the CLI boundary instead of importing repository internals directly.
392
+ - `src/sdk/` remains available for advanced/internal integrations, but it is no longer the primary public entrypoint.
393
+
394
+ ---
395
+
396
+ ## Limitations
397
+
398
+ - Only removes **Gemini visible watermarks** <small>(the semi-transparent logo in bottom-right)</small>
399
+ - Supports both **image** and **video** watermark removal — video processing is available via the [online tool](https://geminiwatermarkremover.io/video)
400
+ - Does not remove invisible/steganographic watermarks. <small>[(Learn more about SynthID)](https://support.google.com/gemini/answer/16722517)</small>
401
+ - Designed for Gemini's current visible watermark pattern <small>(validated against this repo through April 2026)</small>
402
+
403
+ ## Legal Disclaimer
404
+
405
+ This project is released under the **MIT License**.
406
+
407
+ The 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.
408
+
409
+ The author does not condone or encourage the misuse of this tool for copyright infringement, misrepresentation, or any other unlawful purposes.
410
+
411
+ **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.**
412
+
413
+ ## Credits
414
+
415
+ This project is a JavaScript port of the [Gemini Watermark Tool](https://github.com/allenk/GeminiWatermarkTool) by Allen Kuo ([@allenk](https://github.com/allenk)).
416
+
417
+ The Reverse Alpha Blending method and calibrated watermark masks are based on the original work © 2024 AllenK (Kwyshell), licensed under MIT License.
418
+
419
+ ## Related Links
420
+
421
+ - [Gemini Watermark Tool](https://github.com/allenk/GeminiWatermarkTool)
422
+ - [Removing Gemini AI Watermarks: A Deep Dive into Reverse Alpha Blending](https://allenkuo.medium.com/removing-gemini-ai-watermarks-a-deep-dive-into-reverse-alpha-blending-bbbd83af2a3f)
423
+
424
+ ## License
425
+
426
+ [MIT License](./LICENSE)