Skip to main content

ClearCut: AI That Never Sees Your Photos

4 min read

An AI background remover that runs entirely in your browser. Zero uploads. Your photos never leave your device.

AstroReact 19TypeScriptTransformers.jsTailwind CSS v4ZustandWebGPU/WASM

Every background removal tool asks you to upload your photos to their servers.

I built one that doesn’t.

Here’s what I made and why it matters:

  • An AI background remover that runs entirely in your browser
  • Zero uploads. Your photos never leave your device.
  • Open source. So you don’t have to trust me. You can verify.

The Problem

You want to remove a background from a photo. Simple task.

So you Google it. Find a tool. Upload your image.

Done.

But here’s what actually happened: your photo now lives on someone else’s server. Your vacation pics. Your client’s product shots. Your kid’s birthday party. Stored somewhere you don’t control.

Most people don’t think about this. They click “upload” and move on.

I couldn’t stop thinking about it.

That moment of hesitation before uploading. That tiny voice asking “do I really want my photos on their servers?” That’s the problem I wanted to solve.

The Bet

Here’s what I was gambling on: browser-based ML being good enough.

Most developers assume you need server-side GPUs for quality AI inference. The conventional wisdom is clear. Heavy models need heavy hardware. Browsers can’t handle it.

I thought that was outdated.

WebGPU and modern ML runtimes have been quietly closing the gap. Transformers.js now runs Hugging Face models directly in browsers. No servers required.

So I bet I could build a professional-grade background remover that never phones home. Not once.

How I Built It

The constraints were tight:

  • Process everything in-browser. Zero server uploads. Non-negotiable.
  • Keep the model small enough for browsers to download (~45MB max)
  • Work across Chrome, Firefox, Safari with fallbacks
  • Feel fast. Not “waiting for a server” slow.

I chose Transformers.js for inference. It was the only path to true privacy while keeping quality high.

For the model, I tested several options. RMBG-1.4 by BRIA AI won. Best balance of quality and size at ~45MB. It handles hair, transparent objects, and tricky edges better than alternatives.

The architecture breaks into three layers:

Model Layer. Transformers.js loads RMBG-1.4 and caches it in IndexedDB. First visit downloads ~45MB. Every visit after loads from cache in seconds.

Processing Layer. Convert images to blobs. Run them through segmentation. Output grayscale masks showing foreground confidence. WebGPU handles inference when available. WASM provides universal fallback.

Compositing Layer. Combine the mask with the original using canvas destination-in blending. Layer the result over whatever background the user picks. Transparent, solid color, or custom image.

Users can also paint directly on the mask to fix edges the AI misses. (It happens. AI isn’t perfect. Manual touch-ups matter.)

State management? Zustand. Image editing needs undo/redo. Zustand made it easy to implement a 20-step history stack without Redux boilerplate.

The Results

Privacy: 100%. Zero bytes uploaded to any server. Ever.

Cost: Free. No usage limits. No watermarks. No accounts.

Speed: ~2-3 seconds on WebGPU. ~5-8 seconds on WASM fallback.

I released it under MIT license. Because privacy claims mean nothing without transparency. Anyone can audit the code and verify that images never leave the browser.

The repo works as both a usable tool and a reference implementation for privacy-first browser ML.

What I Learned

Client-side ML is production-ready. The gap with server-side has dramatically narrowed. For many use cases, you don’t need a server anymore.

WebGPU adoption is inconsistent. Always design with graceful fallbacks. WASM works everywhere. WebGPU doesn’t. Plan for both.

The initial download is the UX hurdle. ~45MB feels heavy. Investing in progress UI and IndexedDB caching pays off. After the first load, it’s instant.

Privacy constraints force creativity. Building around “zero uploads” seemed limiting at first. It actually pushed me toward better architecture decisions.

Final words.

ClearCut proves privacy and quality aren’t mutually exclusive. You don’t have to trade one for the other.

Your photos stay yours. That’s the whole point.

View on GitHub

Humanly yours, Mujahid :)