agentleFS
allenkallenk/gwt-integrations/SKILL.md

gwt

Skill10 starsChanged 6 months agoMITView on GitHub

Remove Gemini AI watermarks from images using GeminiWatermarkTool (GWT). Use this skill whenever the user mentions: Gemini watermark, 浮水印, AI image cleanup, removing logos from Gemini-generated images, Google ImageFX cleanup, batch processing AI-generated photos, or anything about a semi-transparent logo in the bottom-right corner of an image — even if they don't say "GeminiWatermarkTool" explicitly. Also trigger for follow-up requests like "the corner still looks dirty" or "there's still residual artifacts" after a previous removal attempt.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. SomtoUgeh/somto-dev-toolkit★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Search in this order:

    line 28
  2. Distinctive:

    If not found, run the installer:

    line 39
  3. Very specific:

    Always pass --no-banner: when calling GWT — suppresses ASCII art that wastes tokens.

    line 49
  4. Very specific:

    Use --fallback-region without --snap.

    line 141

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

GeminiWatermarkTool Skill for Claude-Like Agents

Overview

GeminiWatermarkTool (GWT) removes visible Gemini AI watermarks from images using mathematically accurate reverse alpha blending, with optional AI denoising (FDnCNN + NCNN Vulkan GPU) for residual cleanup.

Source: https://github.com/allenk/GeminiWatermarkTool


Binary Location

Search in this order:

  1. Environment variable: GWT_BINARY_PATH
  2. System PATH: GeminiWatermarkTool (or .exe on Windows)
  3. Claude skill bin directory:
    • Windows: %USERPROFILE%\.claude\skills\gwt\bin\GeminiWatermarkTool.exe
    • Linux/macOS: ~/.claude/skills/gwt/bin/GeminiWatermarkTool
  4. Repo-local bin directory (validation mode / fallback):
    • Windows: .\bin\GeminiWatermarkTool.exe
    • Linux/macOS: ./bin/GeminiWatermarkTool

If not found, run the installer:

python ~/.claude/skills/gwt/install.py

For local validation inside this repo only:

python ~/.claude/skills/gwt/install.py --dir ./bin

Always pass --no-banner when calling GWT — suppresses ASCII art that wastes tokens.


Watermark Profile Selection (v0.3.1+)

GWT ships with two watermark profiles. The default targets Gemini 3.5 and later, with automatic legacy fallback.

ProfileTargetsWhen tried
Current (V2)Gemini 3.5 and later outputsfirst, by default
Legacy (V1)Pre-Gemini-3.5 outputsautomatically retried if V2 skips

This means remove_watermark(input, output) already handles mixed Gemini-3.5+ and pre-3.5 inputs without supervision — the CLI tries the current profile, and on skip retries with the legacy profile before reporting the final outcome. Two opt-out paths exist for the rare case where you need to pin a profile:

  • no_legacy=True parameter — disable the automatic fallback (current only)
  • remove_watermark_legacy / remove_watermark_batch_legacy — pin legacy only

Always start with remove_watermark / remove_watermark_batch. The auto-fallback handles the common case. The dedicated *_legacy tools are mostly there for callers that have side knowledge an image is pre-3.5 and want to skip the V2 attempt entirely.

What to do when detection fails ("skipped")

A skipped=True result from the default tool means both profiles tried their best and neither matched. The two indistinguishable causes are:

  1. The image was generated by Gemini, but its watermark has been destroyed by heavy editing/resizing/re-encoding.
  2. The image was not generated by Gemini at all.

Do NOT silently re-invoke remove_watermark_legacy — the automatic fallback has already attempted that. Instead, surface the result to the user and ask whether to escalate:

"I couldn't detect a Gemini watermark on this image (confidence X% on the current profile, Y% on legacy). Either it isn't a Gemini output, or the watermark has been damaged by post-processing. I can try forcing removal at a custom region if you can point me at one — otherwise there's nothing to do."

Escalation paths the agent can offer:

  • --fallback-region br:64,64,500,500 --snap — multi-scale search in a user-supplied area (good for resized / cropped images)
  • Lower --threshold (e.g. 0.15) — relaxes the safety gate; risky on non-Gemini files but legitimate when the user is certain
  • Custom region in the GUI — most user-friendly for one-off cleanup

Decision Logic

Pipeline selection (automatic, based on flags)

FlagsInternal behavior
No advanced flagsStandard 3-stage NCC detection → process or skip
--fallback-region onlyStandard detection first → if not found, apply to fallback region
--fallback-region --snapSkip standard detection entirely → snap search directly
--forceSkip detection, process unconditionally
--legacyPin V1 profile (pre-Gemini-3.5 outputs); skip the V2 attempt entirely
--no-legacyDisable the auto V2 → V1 fallback (current profile only)
no --legacy and no --no-legacyV2 first; auto-retry on V1 if V2 skips (v0.3.1+ default)

Case A — Standard image (not resized after generation)

GeminiWatermarkTool --no-banner -i input.jpg -o clean.jpg

Detection on by default (threshold 25%). Non-watermarked images are skipped safely.

Case B — Image was resized or recompressed

--fallback-region --snap together skips standard detection and goes straight to multi-scale snap search:

GeminiWatermarkTool --no-banner \
  -i input.jpg -o clean.jpg \
  --fallback-region br:64,64,500,500 \
  --snap --snap-max-size 320 --snap-threshold 0.60 \
  --denoise ai --sigma 50 --strength 120

Case C — Unknown image (try standard first, fallback on failure)

Use --fallback-region without --snap. Standard detection runs first; fallback region only activates if standard detection fails:

GeminiWatermarkTool --no-banner \
  -i input.jpg -o clean.jpg \
  --fallback-region br:64,64,500,500 \
  --denoise ai --sigma 50 --strength 120

Full CLI Reference

Core options

FlagDefaultDescription
-i, --input <path>—Input file or directory
-o, --output <path>—Output file or directory
-f, --forcefalseSkip detection, process unconditionally
-t, --threshold <0.0-1.0>0.25Detection confidence threshold
--force-small—Force small watermark size
--force-large—Force large watermark size
--legacy—Pin pre-Gemini-3.5 profile (V1); skips V2 attempt.
--no-legacy—Disable the automatic V2 → V1 fallback.
-v, --verbosefalseDetailed output
-q, --quietfalseSuppress output except errors
--no-banner—Hide ASCII banner (always use in this skill)

Region options

FlagDescription
--region <spec>Explicit watermark region
--fallback-region <spec>Search region when standard detection fails

Region spec formats:

FormatMeaning
x,y,w,hAbsolute pixel coordinates
br:mx,my,w,hBottom-right: margin_right, margin_bottom, width, height
bl:mx,my,w,hBottom-left relative
tr:mx,my,w,hTop-right relative
tl:mx,my,w,hTop-left / absolute
br:autoGemini default position for this image size

Snap engine

FlagDefaultDescription
--snapfalseMulti-scale snap within region/fallback-region
--snap-max-size <32-320>160Maximum watermark size to search
--snap-threshold <0.0-1.0>0.60Minimum confidence to accept match

Denoise / inpaint

FlagDefaultDescription
--denoise <method>offai | ns | telea | soft | off
--sigma <1-150>50FDnCNN noise sigma (ai only)
--strength <0-300>120 (ai) / 85 (others)Blend strength in percent
--radius <1-25>10Inpaint radius (ns / telea / soft only)

Watermark Size Auto-Detection

ProfileSmall logoLarge logoThreshold
V2 (default — Gemini 3.5+)36×3696×96long side > 1024 → large
V1 (--legacy, pre-3.5)48×4896×96long side > 1024 → large

Override with --force-small or --force-large. Profile is selected by --legacy (off = V2, on = V1).


Parameter Tuning Guide

SituationAction
Faint residual--denoise ai --sigma 50 --strength 120
Visible edge artifacts--sigma 75 --strength 180
Strong residual (heavily resized)--sigma 100 --strength 250
Detection keeps skippingLower --threshold 0.15 or add --fallback-region
Snap finds nothingWiden region, increase --snap-max-size 320
Snap confidence too lowLower --snap-threshold 0.40
Wrong size detected--force-small or --force-large

Exit Codes (v0.3.1+)

CodeMeaning
0File processed (or batch directory completed without errors)
1Single-file invocation skipped — no watermark detected on any profile that the chosen flag combination tried
2Real failure — bad arguments, missing input, IO/write error

Batch directory mode keeps lenient semantics (exit 0 unless something actually fails) since partial skips are expected when scanning a folder.


Important Notes

  1. AI denoise GPU fallback: Vulkan GPU used when available, falls back to CPU automatically. If AI init fails entirely, GWT falls back to NS inpainting.
  2. SynthID cannot be removed: Statistically embedded during generation, inseparable from image content.
  3. Supported formats: jpg, jpeg, png, webp, bmp
  4. Batch mode: -i dir/ -o dir/ processes all images; non-watermarked files are skipped safely by default.
  5. Profile auto-fallback (v0.3.1+): by default the CLI tries the current profile, then automatically retries with the legacy profile on skip. Pin a single profile with --legacy (V1 only) or --no-legacy (V2 only) if the auto-fallback isn't what you want.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.