移除gemini生成的图片以及notebooklm生成的图片和PDF中的水印
 
 
 
Go to file
mula.liu 0ecad3a423 v 1.0.1 2026-02-03 13:13:33 +08:00
data v 1.0.1 2026-02-03 13:13:33 +08:00
docs docs: add lossless diff example 2025-12-20 15:30:01 +08:00
public 基本实现三类生成的文件去水印 2026-02-03 00:45:23 +08:00
src v 1.0.1 2026-02-03 13:13:33 +08:00
.env.sample v 1.0.1 2026-02-03 13:13:33 +08:00
.gitignore 基本实现三类生成的文件去水印 2026-02-03 00:45:23 +08:00
Dockerfile v 1.0.1 2026-02-03 13:13:33 +08:00
LICENSE docs: add original author attribution and copyright notice 2026-01-16 12:31:02 +08:00
README.md v 1.0.1 2026-02-03 13:13:33 +08:00
README_zh.md v 1.0.1 2026-02-03 13:13:33 +08:00
build.js 基本实现三类生成的文件去水印 2026-02-03 00:45:23 +08:00
docker-compose.yml v 1.0.1 2026-02-03 13:13:33 +08:00
package.json v 1.0.1 2026-02-03 13:13:33 +08:00
pnpm-lock.yaml 基本实现三类生成的文件去水印 2026-02-03 00:45:23 +08:00
wrangler.toml chore: add Cloudflare deployment configuration 2026-01-16 12:04:34 +08:00
yarn.lock 基本实现三类生成的文件去水印 2026-02-03 00:45:23 +08:00

README.md

中文文档

Gemini & NotebookLM Watermark Cleaner

A privacy-first, browser-based tool for removing watermarks from Gemini and NotebookLM generated content (Images & PDFs). Built with vanilla JavaScript, featuring mathematical precision for lossless restoration and robust fallback cloning for complex document formats.

Features

  • Multi-Format Support: Handles standard Gemini Images (.jpg, .png, .webp) and NotebookLM documents (.pdf).
  • Lossless Restoration: Uses Reverse Alpha Blending for standard Gemini images to perfectly restore original pixels without blurring.
  • Smart Cloning: Applies intelligent Simple Clone (patching) for NotebookLM headers/footers and PDF slides where alpha maps don't apply.
  • Privacy-First: 100% client-side processing. No files are ever uploaded to any server.
  • Batch Processing: Process multiple files at once and download them as a ZIP archive.
  • Modern UI: Dark/Light mode support with a clean, responsive interface.
  • PDF Preview: Real-time progress tracking and preview for PDF file cleaning.

🛠️ Technology Stack

  • Core Logic: Vanilla JavaScript (ES Modules)
  • PDF Processing: pdfjs-dist (Parsing) & jspdf (Re-generation)
  • UI Styling: Tailwind CSS (CDN)
  • Packaging: esbuild for bundling

🧩 How It Works

This tool employs two distinct strategies depending on the content type:

1. Reverse Alpha Blending (for Gemini Images)

Gemini applies watermarks using a standard alpha compositing formula:

Pixel_{watermarked} = \alpha \cdot Pixel_{logo} + (1 - \alpha) \cdot Pixel_{original}

We reverse this to recover the original pixel:

Pixel_{original} = \frac{Pixel_{watermarked} - \alpha \cdot Pixel_{logo}}{1 - \alpha}

By using pre-calibrated Alpha Maps (48px/96px), we can mathematically restore the original pixel values with near-zero loss.

2. Smart Cloning (for NotebookLM & PDF)

For NotebookLM's strip-like watermarks or PDF slides where exact alpha maps vary, the tool uses a Simple Clone technique. It identifies the watermark region and intelligently "clones" a patch of pixels from the immediate neighborhood (e.g., just above the watermark) to cover it, blending the edges for a seamless look.

🔗 Attribution & References

This project is built upon the excellent work of the open-source community. Special thanks to:

🚀 Usage

Development

  1. Clone the repository:
    git clone http://git.unissense.tech/mula/gemini_watermark_cleaner.git
    
  2. Install dependencies:
    pnpm install
    
  3. Start development mode (rebuilds on changes):
    pnpm dev
    
  4. Start a local preview server:
    pnpm serve
    
  5. Build for production:
    pnpm build
    

Docker Deployment

  1. Build and run the container:
    docker-compose up -d --build
    
  2. The application will be available at http://localhost:3000 (or the port specified in .env).

Browser

Simply open the dist/index.html (after building) or the deployed site. Drag and drop your files.

  • Images: Instant preview and cleaning.
  • PDFs: Shows progress per page, then displays the cleaned first page.

📄 License

MIT License