How gargantuax/gemini-watermark-remover works
Gemini Watermark Remover is a local-first image and video watermark-cleanup product, exposed through a browser app, CLI/SDK, Chrome extension, and userscript. The main workflow accepts media, detects the watermark geometry, applies reverse-alpha restoration and candidate evaluation, then returns a downloadable or page-replaced result. Video has a separate detection, backend, and export path. The tree and README establish these product surfaces; sampled source confirms selected image-pipeline, worker, and userscript relationships, so unsampled subsystem wiring is shown conservatively.
Main entry points: watermarkEngine.js Watermark engine · video-app.js Video app · index.js Userscript entry · app.js Browser app
Components 24
Image restoration
- Watermark engine
src/core/watermarkEngine.js - Image pipeline
src/core/imageWatermarkPipeline.js - Initial context
src/core/pipelineInitialContext.js - Candidate selection
src/core/pipelineInitialSelection.js - Candidate quality
src/core/pipelineCandidateQuality.js - Watermark config
src/core/watermarkConfig.js
Video cleanup
- Video app
src/video-app.js - Video detection
src/video/videoWatermarkDetector.js - Veo text detection
src/video/veoTextWatermarkDetector.js - Video backends
src/video/videoCleanupBackends.js - Video export
src/video/videoExport.js
User interfaces
- Browser app
src/app.js - Image worker
src/workers/watermarkWorker.js - CLI
src/cli/gwrCli.js - Remove command
src/cli/gwrRemoveCommand.js
Gemini integration
- Chrome extension
src/extension/contentMain.js - Userscript entry
src/userscript/index.js - Userscript processing
src/userscript/processingRuntime.js - Page process bridge
src/userscript/pageProcessBridge.js
Developer API
- SDK exports
src/sdk/index.js
Other components
- User
- Image or video
- Gemini page
- Cleaned media
Connections 30
- User → Browser app: selects media
- Image or video → Browser app: uploads
- Browser app → Watermark engine: processes image
- Watermark engine → Image pipeline: runs restoration
- Image pipeline → Initial context: creates context
- Initial context → Watermark config: detects geometry
- Image pipeline → Candidate selection: selects candidates
- Candidate selection → Candidate quality: evaluates candidates
- Watermark engine → Cleaned media: returns cleaned image
- Browser app → Image worker: dispatches image work
- Image worker → Watermark engine: processes image
- User → CLI: runs command
- CLI → Remove command: dispatches removal
- Remove command → Watermark engine: removes watermark
- Remove command → Cleaned media: writes output
- User → SDK exports: calls API
- SDK exports → Watermark engine: exposes image engine
- User → Video app: selects video
- Video app → Video detection: detects watermark
- Video app → Veo text detection: detects text mark
- Video app → Video backends: cleans frames
- Video app → Video export: exports video
- Video export → Cleaned media: produces cleaned video
- Gemini page → Chrome extension: provides page images
- Chrome extension → Watermark engine: processes images
- Gemini page → Userscript entry: provides page actions
- Userscript entry → Userscript processing: initializes processing
- Userscript entry → Page process bridge: creates bridge client
- Page process bridge → Userscript processing: falls back to processing
- Userscript entry → Gemini page: replaces previews