@pilio/gemini-watermark-remover 1.0.10 → 1.0.18

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 (44) hide show
  1. package/README.md +221 -199
  2. package/README_zh.md +190 -168
  3. package/package.json +14 -3
  4. package/skills/gemini-watermark-remover/SKILL.md +6 -2
  5. package/skills/gemini-watermark-remover/references/usage.md +5 -1
  6. package/src/core/candidateSelector.js +551 -125
  7. package/src/core/embeddedAlphaMaps.js +7 -4
  8. package/src/core/geminiSizeCatalog.js +130 -13
  9. package/src/core/restorationMetrics.js +166 -0
  10. package/src/core/watermarkEngine.js +14 -1
  11. package/src/core/watermarkProcessor.js +781 -96
  12. package/src/runtime/browser.d.ts +7 -0
  13. package/src/runtime/browser.js +96 -0
  14. package/src/runtime/userscript.d.ts +6 -0
  15. package/src/runtime/userscript.js +28 -0
  16. package/src/sdk/image-data.js +8 -0
  17. package/src/sdk/index.d.ts +0 -1
  18. package/src/sdk/runtime-browser.d.ts +32 -0
  19. package/src/sdk/runtime-browser.js +1 -0
  20. package/src/sdk/runtime-userscript.d.ts +41 -0
  21. package/src/sdk/runtime-userscript.js +1 -0
  22. package/src/shared/actionContextCompat.js +54 -0
  23. package/src/shared/domAdapter.js +279 -0
  24. package/src/shared/errorUtils.js +62 -0
  25. package/src/shared/imageProcessing.js +162 -0
  26. package/src/shared/imageSessionContext.js +98 -0
  27. package/src/shared/imageSessionStore.js +495 -0
  28. package/src/shared/originalBlob.js +79 -0
  29. package/src/shared/pageImageReplacement.js +2370 -0
  30. package/src/userscript/actionContext.js +210 -0
  31. package/src/userscript/bridgeShared.js +72 -0
  32. package/src/userscript/clipboardHook.js +335 -0
  33. package/src/userscript/crossOriginFetch.js +84 -0
  34. package/src/userscript/downloadHook.js +1576 -0
  35. package/src/userscript/historyBindingBootstrap.js +163 -0
  36. package/src/userscript/index.js +341 -0
  37. package/src/userscript/pageProcessBridge.js +283 -0
  38. package/src/userscript/pageProcessorRuntime.js +153 -0
  39. package/src/userscript/processBridge.js +186 -0
  40. package/src/userscript/processingRuntime.js +261 -0
  41. package/src/userscript/runtimeFlags.js +46 -0
  42. package/src/userscript/trustedTypes.js +49 -0
  43. package/src/userscript/urlUtils.js +169 -0
  44. package/src/userscript/userNotice.js +19 -0
package/README.md CHANGED
@@ -1,49 +1,44 @@
1
1
  [中文文档](README_zh.md)
2
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
+
3
5
  # Gemini Watermark Remover — Lossless Watermark Removal Tool
4
6
 
5
- 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.
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.
6
8
 
7
- > **🚀 Looking for the `Online Gemini Watermark Remover (Recommended)`? Try [pilio.ai/gemini-watermark-remover](https://pilio.ai/gemini-watermark-remover)** — free, no install, works directly in your browser.
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)
8
12
 
9
13
  <p align="center">
10
- <a href="https://pilio.ai/gemini-watermark-remover"><img src="https://img.shields.io/badge/🛠️_Online_Tool-pilio.ai-blue?style=for-the-badge" alt="Online Tool"></a>&nbsp;
11
- <a href="https://gemini.pilio.ai/userscript/gemini-watermark-remover.user.js"><img src="https://img.shields.io/badge/🐒_Userscript-Install-green?style=for-the-badge" alt="Userscript"></a>&nbsp;
12
- <a href="https://gemini.pilio.ai"><img src="https://img.shields.io/badge/🧪_Dev_Preview-gemini.pilio.ai-gray?style=for-the-badge" alt="Developer Preview"></a>
13
- </p>
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://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;
16
+ <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;
17
+ <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>
18
+ </p>
14
19
 
15
20
  <p align="center">
16
21
  <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">
17
22
  </p>
18
23
 
19
- ## Features
20
-
21
- - ✅ **100% Local Processing** - All image processing happens locally in your browser or on your machine. Nothing is uploaded.
22
- - ✅ **Mathematical Precision** - Based on the Reverse Alpha Blending formula, not "hallucinating" AI models.
23
- - ✅ **Auto-Detection** - Automatically identifies watermark size and position using Gemini's known output catalog and local anchor search.
24
- - ✅ **Flexible Usage** - Online tool for quick use, userscript for seamless Gemini page integration, CLI and Skill for scripting and automation.
25
- - ✅ **Cross-Platform** - Works in modern browsers (Chrome, Firefox, Safari, Edge) and Node.js environments.
26
-
27
- ## Gemini Watermark Removal Examples
28
-
29
- <details open>
30
- <summary>Click to Expand/Collapse Examples</summary>
31
-  
32
- <p>lossless diff example</p>
33
- <p><img src="docs/lossless_diff.webp"></p>
34
-
24
+ ## Features
35
25
 
36
- <p>example images</p>
26
+ - ✅ **100% Local Processing** - All image processing happens locally in your browser or on your machine. Nothing is uploaded.
27
+ - ✅ **Mathematical Precision** - Based on the Reverse Alpha Blending formula, not "hallucinating" AI models.
28
+ - ✅ **Auto-Detection** - Automatically identifies watermark size and position using Gemini's known output catalog and local anchor search.
29
+ - ✅ **Flexible Usage** - Online tool for quick use, Chrome extension or userscript for seamless Gemini page integration, CLI and Skill for scripting and automation.
30
+ - ✅ **Cross-Platform** - Works in modern browsers (Chrome, Firefox, Safari, Edge) and Node.js environments.
37
31
 
38
- | Original Image | Watermark Removed |
39
- | :---: | :----: |
40
- | <img src="docs/1.webp" width="400"> | <img src="docs/unwatermarked_1.webp" width="400"> |
41
- | <img src="docs/2.webp" width="400"> | <img src="docs/unwatermarked_2.webp" width="400"> |
42
- | <img src="docs/3.webp" width="400"> | <img src="docs/unwatermarked_3.webp" width="400"> |
43
- | <img src="docs/4.webp" width="400"> | <img src="docs/unwatermarked_4.webp" width="400"> |
44
- | <img src="docs/5.webp" width="400"> | <img src="docs/unwatermarked_5.webp" width="400"> |
45
-
46
- </details>
32
+ ## Gemini Watermark Removal Examples
33
+
34
+ <details open>
35
+ <summary>Click to Expand/Collapse Examples</summary>
36
+
37
+ | Original Image | Watermark Removed |
38
+ | :---: | :----: |
39
+ | <img src="docs/demo-before.webp" width="400"> | <img src="docs/demo-after.webp" width="400"> |
40
+
41
+ </details>
47
42
 
48
43
  ## ⚠️ Disclaimer
49
44
 
@@ -66,15 +61,27 @@ An open-source tool to **remove Gemini watermarks** from AI-generated images wit
66
61
 
67
62
  For all users — the fastest and easiest way to remove Gemini watermarks from images:
68
63
 
69
- 1. Open **[pilio.ai/gemini-watermark-remover](https://pilio.ai/gemini-watermark-remover)**.
70
- 2. Drag and drop or click to select your Gemini-generated image.
71
- 3. The engine will automatically process and remove the watermark.
72
- 4. Download the cleaned image.
73
-
64
+ 1. Open **[geminiwatermarkremover.io](https://geminiwatermarkremover.io/)**.
65
+ 2. Drag and drop or click to select your Gemini-generated image.
66
+ 3. The engine will automatically process and remove the watermark.
67
+ 4. Download the cleaned image.
68
+
69
+ ### Chrome Extension
70
+
71
+ Use this if you do not want a userscript manager but still want automatic Gemini page integration for previews, copy, and download actions.
72
+
73
+ 1. Open [Gemini Watermark Remover on the Chrome Web Store](https://chromewebstore.google.com/detail/gemini-watermark-remover/cjlmnfcfnofnglkphbcdclbpimdjkmdf).
74
+ 2. Click **Add to Chrome** and confirm the install.
75
+ 3. Open Gemini. The extension will automatically process supported Gemini images.
76
+
77
+ 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.
78
+
79
+ 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.
80
+
74
81
  ### Userscript
75
82
 
76
83
  1. Install a userscript manager (e.g., Tampermonkey or Greasemonkey).
77
- 2. Open [gemini-watermark-remover.user.js](https://gemini.pilio.ai/userscript/gemini-watermark-remover.user.js).
84
+ 2. Open [gemini-watermark-remover.user.js](https://geminiwatermarkremover.io/userscript/gemini-watermark-remover.user.js).
78
85
  3. The script will install automatically.
79
86
  4. Navigate to Gemini conversation pages.
80
87
  5. Eligible Gemini preview images on the page are replaced in place after processing.
@@ -85,49 +92,66 @@ Current userscript boundaries:
85
92
  - no injected per-image controls
86
93
  - no popup UI or bulk action surface
87
94
  - page previews and native copy/download flows are both processed when the source image is reachable
88
- - preview images keep the original visible while processing, with a subdued `Processing...` overlay
89
- - if preview processing fails, the original page image stays visible and usable
90
-
91
- ### Skill
92
-
93
- For workflows that involve AI coding agents:
94
-
95
- - `skills/gemini-watermark-remover/` contains a packaged Skill that agents can discover and invoke.
96
- - Usage:
97
-
98
- ```bash
99
- node skills/gemini-watermark-remover/scripts/run.mjs remove <input> --output <file>
100
- ```
101
-
102
- - See [`SKILL.md`](skills/gemini-watermark-remover/SKILL.md) for agent integration details.
103
-
104
- ### CLI
105
-
106
- For scripting, CI, and local batch workflows, use the direct CLI:
107
-
108
- ```bash
109
- # repo-local
110
- node bin/gwr.mjs remove <input> --output <file>
111
-
112
- # installed globally
113
- gwr remove <input> [--output <file> | --out-dir <dir>] [--overwrite] [--json]
114
- ```
115
-
116
- If you do not have `gwr` installed globally, use:
117
-
118
- ```bash
119
- pnpm dlx @pilio/gemini-watermark-remover remove <input> --output <file>
120
- ```
121
-
122
- ### Developer Preview
123
-
124
- If you are a developer or contributor, you can preview the latest development build at [gemini.pilio.ai](https://gemini.pilio.ai). This site is a separate online preview/local-processing experience, distinct from the userscript. It may contain experimental features and is not intended for general use.
95
+ - preview images keep the original visible while processing, with a subdued `Processing...` overlay
96
+ - if preview processing fails, the original page image stays visible and usable
125
97
 
126
- ## Development
127
-
128
- ```bash
129
- # Install dependencies
130
- pnpm install
98
+ ### Skill
99
+
100
+ For workflows that involve AI coding agents:
101
+
102
+ - `skills/gemini-watermark-remover/` contains a packaged Skill that agents can discover and invoke.
103
+ - Install it with `skills.sh` using:
104
+
105
+ ```bash
106
+ pnpm dlx skills add GargantuaX/gemini-watermark-remover --skill gemini-watermark-remover
107
+ ```
108
+
109
+ - Add flags like `--agent`, `--yes`, or `--copy` only if your local setup needs them.
110
+ - Usage:
111
+
112
+ ```bash
113
+ node skills/gemini-watermark-remover/scripts/run.mjs remove <input> --output <file>
114
+ ```
115
+
116
+ - See [`SKILL.md`](skills/gemini-watermark-remover/SKILL.md) for agent integration details.
117
+
118
+ ### CLI
119
+
120
+ For scripting, CI, and local batch workflows, use the direct CLI:
121
+
122
+ ```bash
123
+ # repo-local
124
+ node bin/gwr.mjs remove <input> --output <file>
125
+
126
+ # installed globally
127
+ gwr remove <input> [--output <file> | --out-dir <dir>] [--overwrite] [--json]
128
+ ```
129
+
130
+ If you do not have `gwr` installed globally, use:
131
+
132
+ ```bash
133
+ pnpm dlx @pilio/gemini-watermark-remover remove <input> --output <file>
134
+ ```
135
+
136
+ ### Can't Remove Your Watermark?
137
+
138
+ 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:
139
+
140
+ 👉 **[pilio.ai/image-watermark-remover](https://pilio.ai/image-watermark-remover)**
141
+
142
+ ### Developer Preview
143
+
144
+ The repository still keeps a local internal preview harness at `/dev-preview.html` for single-image comparison, copy, and download verification.
145
+
146
+ - This is a retained internal debugging surface, not the public product website.
147
+ - The root path `/` now only redirects users toward the official website, the userscript artifact, and the internal preview page.
148
+ - Public-facing usage should prefer the official website or the userscript instead of this local preview harness.
149
+
150
+ ## Development
151
+
152
+ ```bash
153
+ # Install dependencies
154
+ pnpm install
131
155
 
132
156
  # Development build
133
157
  pnpm dev
@@ -135,16 +159,17 @@ pnpm dev
135
159
  # Production build
136
160
  pnpm build
137
161
 
138
- # Local preview
139
- pnpm serve
140
- ```
141
-
142
- ### Cloudflare Deployment Note
143
-
144
- - `wrangler.toml` is the deployment config for the Cloudflare Worker/assets entry of this project.
145
- - It points Wrangler at the built `dist/` directory and should be kept even if local tests or source imports do not reference it directly.
146
-
147
- ### Tampermonkey Debugging on macOS
162
+ # Local static serving
163
+ pnpm serve
164
+ ```
165
+
166
+ Notes:
167
+
168
+ - The root path `/` is now a lightweight entry page that points to the official website, the userscript artifact, and the retained internal preview page.
169
+ - 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.
170
+ - `pnpm dev` / `pnpm serve` still host the userscript, probe pages, and these static assets.
171
+
172
+ ### Tampermonkey Debugging on macOS
148
173
 
149
174
  For the repo's fixed-profile workflow on macOS:
150
175
 
@@ -159,35 +184,34 @@ pnpm dev
159
184
  ./scripts/open-fixed-chrome-profile.sh --url https://gemini.google.com/app
160
185
  ```
161
186
 
162
- Notes:
163
-
164
- - the fixed profile lives under `.chrome-debug/tampermonkey-profile`
165
- - default CDP port is `9226`
166
- - default proxy is `http://127.0.0.1:7890`; disable it with `--proxy off` if not needed
167
- - reinstall the latest userscript from the active local `pnpm dev` server
168
- - `pnpm dev` starts probing from `http://127.0.0.1:4173/` and auto-increments if that port is already occupied
169
- - if you are following a previously captured debugging session, its port may differ; trust the current `pnpm dev` output instead of hardcoding `4173`
170
-
171
- ## SDK Usage (Advanced / Internal)
172
-
173
- The package root still exposes an SDK, but this path is intended for advanced or internal integration scenarios:
187
+ Notes:
188
+
189
+ - the fixed profile lives under `.chrome-debug/tampermonkey-profile`
190
+ - default CDP port is `9226`
191
+ - default proxy is `http://127.0.0.1:7890`; disable it with `--proxy off` if not needed
192
+ - reinstall the latest userscript from the active local `pnpm dev` server
193
+ - `pnpm dev` starts probing from `http://127.0.0.1:4173/` and auto-increments if that port is already occupied
194
+ - if you are following a previously captured debugging session, its port may differ; trust the current `pnpm dev` output instead of hardcoding `4173`
195
+
196
+ ## SDK Usage (Advanced / Internal)
197
+
198
+ The package root still exposes an SDK, but this path is intended for advanced or internal integration scenarios:
174
199
 
175
200
  ```javascript
176
- import {
177
- createWatermarkEngine,
178
- removeWatermarkFromImage,
179
- removeWatermarkFromImageData,
180
- removeWatermarkFromImageDataSync,
181
- } from '@pilio/gemini-watermark-remover';
182
- ```
183
-
184
- Use the pure-data API when you already have decoded `ImageData`:
201
+ import {
202
+ createWatermarkEngine,
203
+ removeWatermarkFromImage,
204
+ removeWatermarkFromImageData,
205
+ removeWatermarkFromImageDataSync,
206
+ } from '@pilio/gemini-watermark-remover';
207
+ ```
208
+
209
+ Use the pure-data API when you already have decoded `ImageData`:
185
210
 
186
211
  ```javascript
187
- const result = await removeWatermarkFromImageData(imageData, {
188
- adaptiveMode: 'auto',
189
- maxPasses: 4,
190
- });
212
+ const result = await removeWatermarkFromImageData(imageData, {
213
+ adaptiveMode: 'auto',
214
+ });
191
215
 
192
216
  console.log(result.meta.decisionTier);
193
217
  ```
@@ -211,38 +235,38 @@ const second = await removeWatermarkFromImageData(imageDataB, { engine });
211
235
  For Node.js integrations, use the dedicated subpath and inject your own decoder/encoder:
212
236
 
213
237
  ```javascript
214
- import { removeWatermarkFromBuffer } from '@pilio/gemini-watermark-remover/node';
238
+ import { removeWatermarkFromBuffer } from '@pilio/gemini-watermark-remover/node';
215
239
 
216
- const result = await removeWatermarkFromBuffer(inputBuffer, {
217
- mimeType: 'image/png',
218
- decodeImageData: yourDecodeFn,
219
- encodeImageData: yourEncodeFn,
220
- });
221
- ```
222
-
223
- ## Runtime Requirements
224
-
225
- ### Web And Userscript
226
-
227
- - modern Chrome / Firefox / Safari / Edge class browser
228
- - ES modules
229
- - Canvas API
230
- - Async/Await
231
- - TypedArray (`Float32Array`, `Uint8ClampedArray`)
232
- - for the website copy button: `navigator.clipboard.write(...)` and `ClipboardItem`
233
-
234
- ### CLI And Skill
235
-
236
- - a local Node.js runtime capable of running this package and its dependencies
237
- - filesystem access for local input/output paths
238
- - for repo-local usage:
239
-
240
- ```bash
241
- node bin/gwr.mjs remove <input> --output <file>
242
- node skills/gemini-watermark-remover/scripts/run.mjs remove <input> --output <file>
243
- ```
244
-
245
- - for distributed Skill usage, the local environment must be able to execute the packaged `gwr` CLI boundary
240
+ const result = await removeWatermarkFromBuffer(inputBuffer, {
241
+ mimeType: 'image/png',
242
+ decodeImageData: yourDecodeFn,
243
+ encodeImageData: yourEncodeFn,
244
+ });
245
+ ```
246
+
247
+ ## Runtime Requirements
248
+
249
+ ### Web And Userscript
250
+
251
+ - modern Chrome / Firefox / Safari / Edge class browser
252
+ - ES modules
253
+ - Canvas API
254
+ - Async/Await
255
+ - TypedArray (`Float32Array`, `Uint8ClampedArray`)
256
+ - for the website copy button: `navigator.clipboard.write(...)` and `ClipboardItem`
257
+
258
+ ### CLI And Skill
259
+
260
+ - a local Node.js runtime capable of running this package and its dependencies
261
+ - filesystem access for local input/output paths
262
+ - for repo-local usage:
263
+
264
+ ```bash
265
+ node bin/gwr.mjs remove <input> --output <file>
266
+ node skills/gemini-watermark-remover/scripts/run.mjs remove <input> --output <file>
267
+ ```
268
+
269
+ - for distributed Skill usage, the local environment must be able to execute the packaged `gwr` CLI boundary
246
270
 
247
271
  ## Testing
248
272
 
@@ -251,11 +275,11 @@ node skills/gemini-watermark-remover/scripts/run.mjs remove <input> --output <fi
251
275
  pnpm test
252
276
  ```
253
277
 
254
- Regression tests include image fixtures from `src/assets/samples/`.
255
- Source samples stay in git.
256
- Naming and retention rules for those fixtures are documented in `src/assets/samples/README.md`.
257
- Complex preview/download validation notes are documented in `docs/complex-figure-verification-checklist.md`.
258
- Local files under `src/assets/samples/fix/` are optional snapshot outputs for manual regression checks and are intentionally not tracked by git.
278
+ Regression tests include image fixtures from `src/assets/samples/`.
279
+ Source samples stay in git.
280
+ Naming and retention rules for those fixtures are documented in `src/assets/samples/README.md`.
281
+ Complex preview/download validation notes are documented in `docs/complex-figure-verification-checklist.md`.
282
+ Local files under `src/assets/samples/fix/` are optional snapshot outputs for manual regression checks and are intentionally not tracked by git.
259
283
 
260
284
  ## Release Notes
261
285
 
@@ -298,60 +322,58 @@ Default watermark configurations:
298
322
  | Larger Gemini outputs | 96×96 | 64px | 64px |
299
323
  | Smaller Gemini outputs | 48×48 | 32px | 32px |
300
324
 
301
- ## Project Structure
302
-
303
- ```text
304
- gemini-watermark-remover/
305
- ├── bin/ # Published CLI entrypoint (`gwr`)
306
- ├── public/
307
- │ ├── index.html # Main web experience
308
- │ ├── terms.html # Terms of service page
309
- │ └── tampermonkey-worker-probe.* # Probe pages for userscript/debug flows
310
- ├── skills/
311
- │ └── gemini-watermark-remover/ # Distributable agent skill bundle
312
- ├── src/
313
- │ ├── assets/ # Calibration assets and regression samples
314
- │ ├── cli/ # CLI argument parsing and file workflows
315
- │ ├── core/ # Watermark math, scoring, and restoration
316
- │ ├── i18n/ # Web locale resources
317
- │ ├── page/ # Page-side runtime for Gemini page integration
318
- │ ├── sdk/ # Advanced/internal SDK surface
319
- │ ├── shared/ # Shared DOM, blob, and session helpers
320
- │ ├── userscript/ # Userscript entrypoints and browser hooks
321
- │ ├── workers/ # Worker runtime
322
- ├── app.js # Website application entry point
323
- │ └── i18n.js # Internationalization utilities
324
- ├── tests/ # Unit, regression, packaging, and smoke tests
325
- ├── scripts/ # Local automation and debug launchers
326
- ├── dist/ # Build output directory
327
- ├── wrangler.toml # Cloudflare Worker/assets deployment config
328
- ├── build.js # Build script
329
- └── package.json
330
- ```
331
-
332
- ## Architecture Overview
333
-
334
- - `src/core/` contains watermark detection, candidate selection, restoration metrics, and the reverse-alpha removal pipeline.
335
- - `src/userscript/`, `src/page/`, and `src/shared/` implement the real Gemini page integration, including preview replacement plus copy/download interception.
336
- - `src/cli/` and `bin/gwr.mjs` expose file-oriented local automation.
337
- - `skills/gemini-watermark-remover/` provides a distributable Skill that stays on the CLI boundary instead of importing repository internals directly.
338
- - `src/sdk/` remains available for advanced/internal integrations, but it is no longer the primary public entrypoint.
325
+ ## Project Structure
326
+
327
+ ```text
328
+ gemini-watermark-remover/
329
+ ├── bin/ # Published CLI entrypoint (`gwr`)
330
+ ├── public/
331
+ │ ├── index.html # Entry page for official site / userscript / internal preview
332
+ │ ├── dev-preview.html # Internal browser preview harness kept for local debugging
333
+ │ └── tampermonkey-worker-probe.* # Probe pages for userscript/debug flows
334
+ ├── skills/
335
+ │ └── gemini-watermark-remover/ # Distributable agent skill bundle
336
+ ├── src/
337
+ │ ├── assets/ # Calibration assets and regression samples
338
+ │ ├── cli/ # CLI argument parsing and file workflows
339
+ │ ├── core/ # Watermark math, scoring, and restoration
340
+ │ ├── page/ # Page-side runtime for Gemini page integration
341
+ │ ├── sdk/ # Advanced/internal SDK surface
342
+ │ ├── shared/ # Shared DOM, blob, and session helpers
343
+ │ ├── userscript/ # Userscript entrypoints and browser hooks
344
+ │ ├── workers/ # Worker runtime
345
+ │ ├── app.js # Internal single-image preview harness entry point
346
+ └── utils.js # Shared browser helpers for the internal preview page
347
+ ├── tests/ # Unit, regression, packaging, and smoke tests
348
+ ├── scripts/ # Local automation and debug launchers
349
+ ├── dist/ # Build output directory
350
+ ├── build.js # Build script
351
+ └── package.json
352
+ ```
353
+
354
+ ## Architecture Overview
355
+
356
+ - `src/core/` contains watermark detection, candidate selection, restoration metrics, and the reverse-alpha removal pipeline.
357
+ - `src/userscript/`, `src/page/`, and `src/shared/` implement the real Gemini page integration, including preview replacement plus copy/download interception.
358
+ - `src/cli/` and `bin/gwr.mjs` expose file-oriented local automation.
359
+ - `skills/gemini-watermark-remover/` provides a distributable Skill that stays on the CLI boundary instead of importing repository internals directly.
360
+ - `src/sdk/` remains available for advanced/internal integrations, but it is no longer the primary public entrypoint.
339
361
 
340
362
  ---
341
363
 
342
364
  ## Limitations
343
365
 
344
- - Only removes **Gemini visible watermarks** <small>(the semi-transparent logo in bottom-right)</small>
345
- - Does not remove invisible/steganographic watermarks. <small>[(Learn more about SynthID)](https://support.google.com/gemini/answer/16722517)</small>
346
- - Designed for Gemini's current visible watermark pattern <small>(validated against this repo through April 2026)</small>
366
+ - Only removes **Gemini visible watermarks** <small>(the semi-transparent logo in bottom-right)</small>
367
+ - Does not remove invisible/steganographic watermarks. <small>[(Learn more about SynthID)](https://support.google.com/gemini/answer/16722517)</small>
368
+ - Designed for Gemini's current visible watermark pattern <small>(validated against this repo through April 2026)</small>
347
369
 
348
- ## Legal Disclaimer
349
-
350
- This project is released under the **MIT License**.
351
-
352
- 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.
353
-
354
- The author does not condone or encourage the misuse of this tool for copyright infringement, misrepresentation, or any other unlawful purposes.
370
+ ## Legal Disclaimer
371
+
372
+ This project is released under the **MIT License**.
373
+
374
+ 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.
375
+
376
+ The author does not condone or encourage the misuse of this tool for copyright infringement, misrepresentation, or any other unlawful purposes.
355
377
 
356
378
  **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.**
357
379