Menu

1 / 2

I built a background remover that runs 100% in the browser. Here's how I made it 7x faster

DEV Community: javascript·Manish joshi·about 5 hours ago
#sesZVmLb
#devtojavascript#devto#dev#model#onnx
Long article (1177 words) — no AI summary yet.
Reading 0:00
15s threshold

Most "free" background removers upload your photo to a server, run a model on a GPU, and then ask you to pay for the full-resolution download. I wanted the opposite: the photo never leaves your device , the download is full resolution, and there is no account.

So I built Remove de Fundo , a background remover where the AI model runs entirely in the browser. The first version worked, but on real phones it was slow enough that people left before seeing a result. This post is about what made it slow and what fixed it.

End result on the same laptop and the same photo: 43.8 s → 6.4 s from click to cutout.

The stack

Astro for the site (static pages, deployed to Cloudflare Workers)

@imgly/background-removal with the IS-Net fp16 model (~88 MB)

ONNX Runtime Web , which runs the model with WebGPU on desktop and WebAssembly (CPU) on phones

A small post-processing step in canvas to clean up semi-transparent "haze" in the mask

Everything happens client-side.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.