{"slug": "show-hn-remove-the-gemini-watermark-by-solving-the-alpha-blend-not-inpainting", "title": "Show HN: Remove the Gemini watermark by solving the alpha blend, not inpainting", "summary": "A developer released an open-source tool that removes the Gemini sparkle watermark from AI-generated images by solving the alpha blend equation, recovering original pixels exactly without inpainting. The tool runs entirely locally as a browser tool, TypeScript library, or CLI, and uses a two-step detection process that checks whether the mark's outline vanishes and whether the result matches surrounding image patches.", "body_md": "Remove the **Gemini ★ sparkle watermark** from images you generated with Google\nGemini or **Nano Banana** — entirely on your own machine. No uploads, no\nsign-up, no server. Works as a browser tool, a TypeScript library, and a CLI.\n\nLook at the stars inside the sparkle's outline. They are *back*, not painted\nover — see [how it works](#how-it-works).\n\nWhat this does — and doesn't.This removes thevisiblecorner sparkle only. It doesnottouch[SynthID]or any other invisible provenance watermark, and it never will. Google itself already ships watermark-free images to AI Ultra subscribers; this gives you the same clean canvas for contentyou generated yourself.\n\n**Try it:** [geminiwatermarkwiper.com](https://geminiwatermarkwiper.com) — same\nengine, running in your browser tab.\n\nThe mark is composited as a plain alpha blend:\n\n```\nobserved = α · overlay + (1 − α) · original\n```\n\nThat equation is invertible. If you know the overlay — its exact colour and its exact alpha, per pixel — the original comes back:\n\n```\noriginal = (observed − α · overlay) / (1 − α)\n```\n\nSo the whole problem reduces to *knowing the overlay*, and it can be solved for\nexactly. Ask Gemini for a flat white image and a flat black one. Both come back\ncarrying the same mark, over backgrounds you already know, which is two equations\nper pixel for two unknowns:\n\n```\nα = 1 − (obs_white − obs_black) / (bg_white − bg_black)\noverlay = (obs_black − (1 − α) · bg_black) / α\n```\n\nThe recovered mark peaks at **31% opacity** and is nowhere near opaque, so the\noriginal pixels were never destroyed — they were only dimmed. Reversing the blend\nrestores them outright. Nothing is inpainted, nothing is guessed at, and the\nstars that were under the sparkle come back exactly as they were.\n\nThe template lives in [ src/template-sparkle.ts](/long66666/gemini-watermark-remover/blob/main/src/template-sparkle.ts);\n\n[regenerates it if Google ever changes the mark.](/long66666/gemini-watermark-remover/blob/main/scripts/extract-template.mjs)\n\n`scripts/extract-template.mjs`\n\nGoogle composites the mark at a fixed **48px**, inset a fixed **96px** from the\nright and bottom — the same absolute pixels in a 1024×1024 image and a 1408×768\none, not scaled to the frame.\n\nConfirming the mark is *there* is the harder half, and most of the obvious\napproaches quietly fail. Matching on colour finds teal lakes. Correlating the\ntemplate's shape against brightness is buried by gravel and fooled by any smooth\ngradient. And one unmarked photo has a grey rock sitting exactly where the\nsparkle would be, matching an overlay's brightness to within 5%, which defeats\nevery test based on amplitude.\n\nWhat works is to remove the overlay and ask whether it *explained* the pixels —\nspecifically, what happens to the gradient energy along the mark's own\nsilhouette, the ring where the template's alpha changes fastest and a composited\nedge would live:\n\n**The outline must vanish.** Subtracting a sparkle from something that isn't one manufactures edges instead of erasing them.**What's left must look like the rest of the photo**, judged against control patches beside it. The rock fails here: it isn't star-shaped, so cutting a star out of it leaves its edges standing.\n\nBoth gates are in [ src/detect.ts](/long66666/gemini-watermark-remover/blob/main/src/detect.ts), with the measurements that\nset them.\n\n**100% local**— images never leave your machine** Exact reconstruction**, not inpainting: the pixels under the mark are recovered, not approximated** Says no when it means no**— an image with no sparkle is returned untouched rather than scrubbed- Batch CLI for folders of images — PNG, JPG, WebP\n- Zero runtime dependencies in the core;\n`sharp`\n\nonly for the CLI\n\n``` js\nimport { removeWatermark } from 'gemini-watermark-remover';\n\n// imageData: ImageData from a canvas, or { width, height, data }\nconst result = removeWatermark(imageData);\n\nif (result.mode === 'none') {\n  // No sparkle found. The image is returned unchanged.\n} else {\n  ctx.putImageData(\n    new ImageData(result.image.data, result.image.width, result.image.height),\n    0,\n    0,\n  );\n}\nnpx gemini-watermark-remover input.png              # writes input-clean.png\ngwr *.png --suffix -nowm                            # batch\ngwr shot.jpg -o clean.jpg --region 900,980,120,120  # override detection\n```\n\nNano Banana is the community name for Gemini's image model — its images carry the same sparkle, so everything here applies unchanged.\n\nOn the roadmap: the same template applied per-frame via WebCodecs. Watch the repo.\n\n- Images carrying the\n**large \"Gemini\" wordmark**(a different, much bigger overlay) are not supported yet. They are detected as unsupported and left alone rather than half-erased. Extracting that template needs a flat white/black pair from the export path that produces it. - The mark is assumed to be at Google's standard placement. A cropped or resized\nimage may need\n`--region`\n\n.\n\nUse this on **content you generated yourself**. Invisible provenance (SynthID) is\ndeliberately left intact — this project is about a clean visual canvas, not about\ndefeating AI-content detection.\n\nMIT", "url": "https://wpnews.pro/news/show-hn-remove-the-gemini-watermark-by-solving-the-alpha-blend-not-inpainting", "canonical_source": "https://github.com/long66666/gemini-watermark-remover", "published_at": "2026-07-21 09:12:15+00:00", "updated_at": "2026-07-21 09:53:30.110624+00:00", "lang": "en", "topics": ["ai-tools", "computer-vision", "developer-tools"], "entities": ["Google Gemini", "Nano Banana", "SynthID", "geminiwatermarkwiper.com"], "alternates": {"html": "https://wpnews.pro/news/show-hn-remove-the-gemini-watermark-by-solving-the-alpha-blend-not-inpainting", "markdown": "https://wpnews.pro/news/show-hn-remove-the-gemini-watermark-by-solving-the-alpha-blend-not-inpainting.md", "text": "https://wpnews.pro/news/show-hn-remove-the-gemini-watermark-by-solving-the-alpha-blend-not-inpainting.txt", "jsonld": "https://wpnews.pro/news/show-hn-remove-the-gemini-watermark-by-solving-the-alpha-blend-not-inpainting.jsonld"}}