Status: Deploy Ready
Author: Curzy
Date Created: 2026-07-19
Version: 1.0
Related local repos: .sample/gemini-watermark-remover (Node image WM), .sample/notebooklm-watermark-remover-v2 (Python PDF WM), .sample/rembg (placeholder, empty)
A user who gets a Gemini-generated image or a NotebookLM PDF export must (1) remove the background, (2) remove the Gemini SynthID watermark, and/or (3) remove the NotebookLM footer watermark. Each currently lives in a different tool with different run modes (browser userscript, Node CLI, Python FastAPI). There is no single entry point.
- Background removal: separate SaaS or local model.
- Gemini image watermark:
gemini-watermark-removerTampermonkey userscript or Node CLI — not a website. - NotebookLM PDF watermark:
notebooklm-watermark-remover-v2FastAPI app — separate site. - User manually downloads, re-uploads, and re-downloads between tools.
- User: 3 tabs, 3 formats, repeated uploads, dropped files.
- Business: none yet (personal/project tool); value is time saved + a shippable all-in-one utility.
The three engines already exist locally in .sample/. Wrapping them is a low-cost build with immediate personal/utility value.
- Ship a working all-in-one web utility reusing existing engines (no net-new ML research).
- Keep it free/self-hostable (no paid API keys) by using MIT/local models.
- Upload one file, get one cleaned file.
- Not care which engine runs — the app routes by file type/content.
- Trust it runs locally/privately (no third-party upload of their images).
- Not building new watermark-detection ML.
- Not supporting video in MVP (the Gemini repo has
dist/video-app.jsbut it is out of scope for v1). - Not a paid SaaS with accounts/billing in MVP.
- Content creators — clean AI-generated images for reuse (bg gone + watermark gone in one place).
- Students / researchers — strip NotebookLM image watermark from exported assets.
- Tech-savvy enough to drag-drop a file; not CLI/userscript users.
As a creator,
I want to upload one image and receive one image with background removed and Gemini/NotebookLM watermark stripped,
So that I don't run three tools.
Acceptance Criteria:
- Given a PNG/JPG with a background and a Gemini SynthID watermark, when uploaded, then output has transparent background + no visible watermark.
- Given an image with no watermark, when uploaded, then only background is removed (no corruption).
- Edge: given a non-image file, when uploaded, then clear error, no processing.
Priority: P0 | Effort: M | Dependencies: gemini-watermark-remover engine, @imgly/background-removal
As a student,
I want to upload a NotebookLM PDF and get the same PDF with the footer watermark removed,
So that I can use it in class.
Acceptance Criteria:
- Given a NotebookLM-exported PDF, when uploaded, then output PDF has the bottom-right watermark box repainted with sampled background.
- Given a PDF with no detectable NotebookLM watermark, when uploaded, then PDF returned unchanged (or user notified "no watermark found").
- Edge: PDF > 50MB rejected with message.
Priority: P2 (future) | Effort: S | Dependencies: notebooklm-watermark-remover-v2
As any user,
I want the app to detect image vs PDF and run the right pipeline,
So that I don't pick a mode.
Acceptance Criteria:
- Given
*.png/*.jpg/*.webp, route to image pipeline (the only pipeline in v1). - Given
*.pdf, show "PDF belum didukung di v1" (deferred — see Decision Log #5). - Given unsupported type, show supported-format message.
Priority: P0 | Effort: S
As a user,
I want a before/after preview and a download button,
So that I can verify and save the result.
Acceptance Criteria:
- Output preview shown after processing.
- Download link returns the original format (PNG for images, PDF for PDFs).
- Image output keeps transparency (PNG).
Priority: P0 | Effort: S
| Req ID | Description | Priority | Status |
|---|---|---|---|
| FR-001 | Accept single image upload (PNG/JPG/WEBP) | P0 | Open |
| FR-002 | Remove background via @imgly/background-removal |
P0 | Open |
| FR-003 | Strip Gemini/NotebookLM SynthID image watermark (reuse Node engine) | P0 | Open |
| FR-004 | Accept single PDF upload | P2 (future) | Open |
| FR-005 | Strip NotebookLM PDF footer watermark (reuse Python engine) | P2 (future) | Open |
| FR-006 | Auto-detect file type and route pipeline | P0 | Open |
| FR-007 | Before/after preview + download | P0 | Open |
| FR-008 | Error states for unsupported/oversized files | P1 | Open |
| Req ID | Category | Description | Target |
|---|---|---|---|
| NFR-001 | Performance | Image pipeline (bg + WM) | < 15s for 1024px on a typical laptop |
| NFR-002 | Performance | Browser first-load (CDN model fetch) | WASM ~24MB + model ~40MB; cached after first load |
| NFR-003 | Privacy | Files processed locally / in-page | No third-party upload |
| NFR-004 | Compatibility | Browsers | Chromium + Firefox latest |
| NFR-005 | Accessibility | WCAG 2.1 AA for the upload UI | AA |
- One-upload image pipeline: bg removal (
@imgly) + Gemini/NotebookLM SynthID image watermark strip (gemini-watermark-removerCanvas engine). - Auto-routing by extension (image types only in v1).
- Preview + download.
- Self-hosted / static, no paid keys, no server.
- PDF pipeline (NotebookLM footer strip) — deferred (see Decision Log #5; requires Python/PyMuPDF which can't run in-browser or on Vercel static). Moves to a future release with a serverless container or separate deployment.
- Video watermark removal (Gemini repo has
video-app.jsbut excluded). - User accounts / cloud storage.
- Batch / zip upload of many files.
- New ML models; we only reuse existing engines.
- Batch upload.
- Adjustable WM-strip aggressiveness slider.
- Video pipeline.
- Hosted multi-user deployment with queue.
100% browser-side. No backend, no server, no API. Vite bundles two engines into static files served from Vercel edge:
index.html (upload UI + preview)
│
▼ (in-browser, no network)
[1] @imgly/background-removal (ONNX WASM, model from CDN at runtime)
→ removes background, outputs transparent PNG as Blob
│
▼ (in-browser, Canvas pipeline)
[2] gemini-watermark-remover engine (pure Canvas, imported as JS module)
→ detects + strips SynthID watermark using geometry + alpha estimation
│
▼ (Canvas.toBlob / convertToBlob)
Download button → user saves cleaned PNG
Both engines run in the user's browser. No file leaves the machine.
- Frontend: Plain HTML + vanilla JS, bundled by Vite (bundler only, no framework).
- Background engine:
@imgly/background-removal(MIT) — ONNX WASM, model fetched from CDNhttps://staticimgly.com/@imgly/background-removal-data/...at runtime. Configured model:isnet_fp16, preloaded on page load. - Image WM engine:
gemini-watermark-removerbrowser build, copied intosrc/lib/gemini-wm/as JS modules. Pure Canvas + alpha-map estimation — no ONNX for the image path. - Hosting: Vercel static (
dist/output). COOP/COEP headers invercel.jsonenable SharedArrayBuffer (WASM threading). - Privacy: no server, no API, no upload. Files processed in-page only.
None. No network calls except the @imgly model CDN fetch (first load, cached after).
- Validate file type (
image/png|jpeg|webp) + size (≤ 20MB) at the input boundary before processing. - No temp files, no server, no PII retention, no logs of image contents.
- If deployed publicly, add rate limiting at the CDN/edge level (defense-in-depth only — app itself has no server).
- Image pipeline is CPU/ONNX-heavy; runs sequentially (bg first, then WM). First load pulls ~24MB ONNX WASM + ~40MB model from CDN, then cached.
- Expect seconds-to-tens-of-seconds on laptop CPU for 1024px.
- Files never leave the browser. No storage, no retention, no server logs.
- One drop zone. No mode selection. "Upload → wait → download."
- Show a spinner with stage label ("Removing background…" → "Stripping watermark…").
- Before/after side-by-side for images.
- User opens site.
- Drag/drop or pick one file.
- App detects type, shows progress stages.
- Preview appears; download button enabled.
- User downloads; temp file deleted.
Reuse the existing glassmorphism style from the sample apps (dark, blurred cards). No new design system needed.
- Labeled file input, keyboard-operable drop zone,
alt/status text for preview, AA contrast.
- Mobile: single column, full-width drop zone. Desktop: before/after split.
- Upload / Dropzone — single screen. States: Normal (idle dropzone + hint), Loading (progress bar + stage label), Error (red status text), Done (before/after grid + download).
- Before/After Preview — two figure cards (Sebelum / Sesudah) on a checker background to show PNG transparency. States: Hidden (pre-process), Visible (post-process).
- Download — emerald anchor button,
download="cleaned.png". States: Disabled (pre-process), Enabled (post-process). - No settings screen, no modal, no nav (single-screen utility).
| Scenario | Handling |
|---|---|
| Unsupported file type (not png/jpg/webp) | Block at input, status text: "Format tidak didukung (PNG/JPG/WebP)". |
| File > 20MB | Reject before processing, status text: "File terlalu besar (max 20MB)". |
| Background removal model fails to load (CDN/network) | Catch promise rejection, status text: error + hint to retry / check connection. |
| Watermark step throws on a frame | Skip WM step, return bg-removed image with warning status; never crash the pipeline. |
| Browser lacks SharedArrayBuffer (no COOP/COEP) | WASM falls back to single-thread; slower but functional. Header misconfig flagged in console. |
Single checkpoint-based timeline (no weekly phases — Vite scaffold + builder verification already done):
| Phase | Deliverables |
|---|---|
| ✅ Scaffold | Vite project + index.html upload UI + src/main.js orchestrator |
| ✅ Build | Image pipeline wired (bg removal + Gemini image WM), build passes (57 modules, 24MB) |
| ✅ Verify | Gemini engine standalone test passed (1024×1024, watermark removal correct) |
| Pending | End-to-end test in real browser (headless @imgly WASM stalls — environment, not code) |
| Pending | Deploy to Vercel (vercel --prod) + verify in real browser |
| Risk | Impact | Prob | Mitigation |
|---|---|---|---|
@imgly/background-removal model download + WASM size (~24MB WASM + ~40MB model from CDN) |
Med | Med | Preload on page load; model cached in browser after first fetch. Vendor model into public/ later for offline/private use. |
| Headless/CI WASM stalls (CPU ONNX slow in sandboxed env) | Low | Med | Real browser fine; headless test env only. Not a code defect. |
| Gemini WM miss on unusual image sizes | Low | Med | Before/after preview lets user reject; engine's size catalog covers common Gemini/NotebookLM outputs. |
| Watermark-removal side effects on non-watermarked areas | Low | Low | Only run WM step on detected watermark zones (geometry-based). |
-
gemini-watermark-removerbrowser build vendored intosrc/lib/gemini-wm/(Canvas engine, no build step). -
@imgly/background-removalnpm package available (replaces emptyrembg). - Vite +
vercel.json(COOP/COEP headers) configured.
- User accepts local/self-hosted run (no hosted multi-tenant in v1).
- Input is a single file per request.
- Gemini watermark is the SynthID type the Node engine targets (geometry+alpha), not arbitrary text overlays.
| # | Keputusan | Alternatif | Alasan |
|---|---|---|---|
| 1 | 100% browser-side, no backend | Node/Express orchestrator + Python FastAPI sidecar | Vercel static gratis; @imgly sudah WASM-native; gemini WM engine punya build browser. Server = biaya + maintenance. |
| 2 | HTML + vanilla JS + Vite (no React/Vue) | Next.js, React, Astro | Single-screen, no routing/state. Vite cuma bundler WASM. React = 200KB overhead tak terpakai. |
| 3 | @imgly/background-removal for remove-bg | rembg (empty), remove.bg API (berbayar), u2net manual | MIT, npm install, ONNX WASM in-browser. remove.bg butuh API key + bayar per request. |
| 4 | Gemini WM engine pure Canvas (bukan ONNX di image path) | ONNX video approach | Image WM = geometry + alpha-map estimation via Canvas. ONNX hanya untuk video denoise. Bundle tetap kecil. |
| 5 | PDF pipeline deferred ke future | Proxy ke notebooklm Python server | PyMuPDF gak bisa di browser; Vercel static gak proxy FastAPI. V1 fokus image; PDF masuk roadmap. |
- Orchestrator language? → Resolved: no orchestrator. 100% browser-side (Decision Log #1).
- Where does bg removal run? → In-browser WASM (
@imgly), model from CDN. No server (Decision Log #1). - Combine into one repo? → Yes, single Vite repo, engines vendored into
src/lib/. - Self-host model vs CDN fetch? Privacy-conscious deployments may want to vendor the @imgly ONNX model into
public/to avoid the CDN call. Out of scope for v1 (CDN default). - PDF pipeline delivery? Future: either a Vercel serverless Python function (PyMuPDF) or a separate small service. Not decided.
| Link | Pattern |
|---|---|
| GitHub | github.com/curzyori/rm-bg |
| Website | rm-bg.curzy.dev |
| Donate | donate.curzy.dev |
Static web app — no native binary.
| Platform | Format | Hosting |
|---|---|---|
| Web | Static build (dist/ from vite build) |
Vercel static (vercel --prod) |
| Self-host | Static files (any static server) | python3 -m http.server / nginx |
COOP/COEP headers (set in vercel.json) required for ONNX WASM SharedArrayBuffer threading.
.sample/gemini-watermark-remover/AGENTS.md— watermark size/anchor catalog, build notes..sample/notebooklm-watermark-remover-v2/app.py— PDF WM FastAPI..sample/rembg— empty placeholder; superseded by@imgly/background-removal.
- SynthID: Google's invisible/visible AI watermark; the Gemini image engine targets its visible bottom-right mark.
- ONNX: Open model format used by both bg + WM engines.