$ show GargantuaX/gemini-watermark-remover
A comprehensive tool for removing watermarks from Gemini AI-generated images and videos. It provides multiple deployment options: a Chrome extension, a Tampermonkey userscript, an npm package (SDK), a CLI, and an AI agent skill. The core algorithm uses mathematically exact reverse alpha blending with pre-calibrated alpha maps to remove the Gemini logo without degrading underlying image quality. The system includes a sophisticated pipeline for detection, candidate selection, alpha trial, repair, and quality evaluation, with support for both image and video watermark removal. The repository is hybrid: while primarily an application, it contains an extensive set of data/research scripts for benchmarking, alpha profile analysis, video residual analysis, and release quality gating, reflecting a data-driven development approach. The codebase is well-structured with clear separation of concerns, extensive test coverage, and modular components that can be reused in other projects.
The LLM identified 4 files worth highlighting for reuse:
Implements the core mathematical inverse of alpha compositing. Contains functions like `removeWatermark` that take a source image, alpha map, and blend mode to reconstruct the original unwatermarked image pixel by pixel. This is a self-contained, reusable algorithm that can be extracted for any project needing to remove a known alpha-blended overlay.
Provides functions for loading, caching, and interpolating alpha maps. The `interpolateAlphaMap` function can resize a known alpha map to any dimensions using cube-root-based confidence adjustment, making it reusable for watermark detection at non-standard sizes. Contains `getEmbeddedAlphaMap` and `calculateAlphaMap` for flexible alpha map retrieval.
Implements a WatermarkWorkerClient that manages a Web Worker for offloading image processing. Uses a ping/process protocol with timeout and error handling. This pattern is reusable for any application that needs to move heavy image processing off the main thread with a clean Promise-based API.
Contains a comprehensive, manually curated catalog of Gemini image sizes and their corresponding watermark configurations (logo size, margins, alpha variants). It provides functions like `resolveOfficialGeminiWatermarkConfig` and `resolveGeminiWatermarkSearchConfigs` that map image dimensions to candidate watermark positions. This is a reusable data asset for any Gemini watermark-related tool, with sophisticated projection logic for near-official sizes.