Skip to content

foxbinner/GemClean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✨ GemClean — Gemini Watermark Remover 🧹

Stack License

GemClean is an ultra-fast, privacy-first browser tool that erases visible watermarks from AI-generated images — entirely on your device. No uploads, no servers, no compromises. It leverages a precise Reverse Alpha Blending algorithm to mathematically restore original pixels with zero quality degradation.


🔍 Overview

AI image generators like Google Gemini embed a small sparkle logo into every exported image. GemClean reverses the blending math to recover the clean, original pixels — all within milliseconds, right inside your browser tab.


🚀 Key Features

Feature Detail
Offline & Private Zero network requests. Every pixel stays on your machine.
Mathematically Lossless Exact inverse-blend formula — no AI guesswork, no quality loss.
Instant Processing Sub-second results even on large 4K images.
Auto Size Detection Automatically picks the correct 48 px or 96 px alpha map.
Batch Support Drop multiple files at once; download them all as a ZIP.
Dark / Light Mode Respects your system theme or toggle manually.
Zero Build Step Pure ES6 modules + Tailwind CDN. Clone → serve → done.

🧮 Algorithm Deep-Dive

🖼️ Step 1 — How the watermark is applied

The AI renderer composites a semi-transparent white logo on top of the original image using standard alpha blending:

$$C_{out} = \alpha \cdot C_{logo} + (1 - \alpha) \cdot C_{src}$$

Symbol Meaning
$\alpha$ Per-pixel opacity of the watermark (0 → 1)
$C_{logo}$ Watermark colour — pure white (255)
$C_{src}$ The original pixel we want back
$C_{out}$ The watermarked pixel you downloaded

🔄 Step 2 — Reversing the math

We know $C_{out}$, $C_{logo}$, and the full $\alpha$ map (extracted once from reference captures). Solving for $C_{src}$:

$$C_{src} = \frac{C_{out} - \alpha \cdot C_{logo}}{1 - \alpha}$$

The result is clamped to [0, 255] and rounded to the nearest integer.

🗺️ Step 3 — Alpha map extraction

Two reference PNGs (bg_48.png, bg_96.png) capture the isolated watermark at both supported sizes. On first load, each reference is drawn to an off-screen canvas and its max channel value per pixel is normalised into a Float32Array — giving us a per-pixel opacity map accurate to floating-point precision.


📁 Repository Layout

GeminiLogoRemover/
├── assets/
│   ├── bg_48.png          # Alpha reference — small images (≤ 1024 px)
│   └── bg_96.png          # Alpha reference — large images (> 1024 × 1024 px)
├── js/
│   ├── alphaMap.js        # Builds the Float32 opacity map from a reference PNG
│   ├── blendModes.js      # Reverse alpha-blend formula implementation
│   ├── engine.js          # Orchestrator — loads assets, runs pipeline
│   └── app.js             # DOM bindings, drag-and-drop, download logic
└── index.html             # Single-page application entry point

🛠️ Tech Stack

Layer Choice
Markup Semantic HTML5
Styling Tailwind CSS via CDN — zero build config
Logic Vanilla ES6+ modules — no React, no Vue, no bundler
Icons Iconify (on-demand SVG delivery)
Archiving JSZip for multi-file downloads

⚡ Quick Start

Note: ES6 module imports require a local HTTP server — opening index.html via file:// will fail due to CORS.

VS Code (recommended)

  1. Install the Live Server extension.
  2. Right-click index.htmlOpen with Live Server.

Python one-liner

python -m http.server 8080

Node one-liner

npx serve .

Then open http://localhost:8080 in any modern browser.


⚠️ Disclaimer

This project is intended for educational and personal use only.

  • It removes the visible sparkle logo only; it does not strip the invisible SynthID metadata embedded by Google.
  • Always respect the Terms of Service and intellectual-property rights of the original image generator.

👤 Author & Credits

Developed & maintained by LittleFox


© 2026 LittleFox. Released under the MIT License.

About

GemClean is an ultra-fast, privacy-first browser tool that erases visible watermarks from AI-generated images — entirely on your device.

Resources

License

Stars

Watchers

Forks

Contributors