A technical guide to how BG-Zero performs AI background removal entirely in your browser using WebAssembly, WebGPU, and ONNX Runtime — without sending images to any server.
This article explains the technology behind removing backgrounds without uploading images. See our complete no-upload background removal guide.
Client-side background removal means the AI model that detects and removes image backgrounds runs entirely within your web browser — on your device's CPU or GPU — rather than on a remote cloud server.
The key distinction: your image data never crosses a network boundary. The AI inference happens where the image already is — on your machine.
Here's how BG-Zero processes an image from start to finish, entirely client-side. Each step happens inside your browser — the original image never leaves your device.
When the user selects a file, the browser reads it through the local file APIs and decodes it into pixel data inside the page session. The app can then inspect width, height, file type, and preview state before any model inference begins. This stage does not require an image upload endpoint: the selected file stays in memory or a temporary browser object URL while the UI prepares the preview.
AI models usually expect a specific input shape. The browser may resize the image, convert color channels, normalize pixel values, and pack the data into a tensor-like format. This transformation is technical but important: it turns a regular image file into the numeric input that the segmentation model can understand.
The segmentation model predicts which pixels belong to the foreground subject and which pixels belong to the background. Depending on the implementation and browser capabilities, this work may run through WebAssembly, WebGPU, or another optimized JavaScript path. The output is typically a mask: each pixel receives a value that represents how strongly it should be kept or removed.
The raw mask may need edge refinement before export. The browser can smooth jagged edges, soften hair-like areas, remove small artifacts, and combine the mask with the original pixels. The final result is usually an RGBA image where the alpha channel controls transparency.
After composition, the browser can encode the result as PNG or WebP and trigger a local download. At this point, the app only needs to provide the user with the generated output file. The original image does not need to be sent to a server to complete the background removal workflow.

BG-Zero can use two execution backends for AI inference:
| Aspect | WebAssembly (WASM) | WebGPU |
|---|---|---|
| Execution target | CPU (multi-threaded) | GPU (parallel compute) |
| Browser support | All modern browsers | Chrome 113+, Edge 113+ |
| Speed (typical image) | 2–8 seconds | 0.5–2 seconds |
| Fallback | Always available | Falls back to WASM if no GPU |
WebAssembly is the dependable baseline for browser-side AI workloads. It is designed to run low-level compiled code in the browser with predictable performance across modern browsers. For background removal, a WASM path is useful because it can work on a wide range of devices and can act as the fallback when GPU acceleration is unavailable. It may not always be the fastest option, but it is usually the safer default for compatibility. WebGPU is better understood as an acceleration path rather than a universal requirement. When available, it can let the browser use the device GPU for parallel computation, which is a natural fit for image and tensor operations. However, WebGPU availability can still depend on browser version, operating system, hardware, graphics driver, and security policy. A robust client-side remover should detect WebGPU at runtime and gracefully fall back to WASM when it is not available.

For client-side background removal, browser support should be explained as a progressive enhancement story. WebAssembly is the stable baseline for modern browsers, while WebGPU is the acceleration layer that can improve performance when the browser, operating system, and hardware allow it. The safest product design is to detect capabilities at runtime instead of promising one fixed runtime for every visitor.
| Capability | 2026 Support | For Background Removal | Fallback |
|---|---|---|---|
| WebAssembly | Mature support across modern Chrome, Edge, Firefox, and Safari | Good baseline for running compiled inference code in the browser | Optimized JS for unsupported environments |
| WebGPU | Available in current major browser families, but actual availability varies by device, OS, driver, and security context | Useful for GPU-accelerated tensor/image operations when enabled | Fall back to WASM when navigator.gpu is unavailable |
| Canvas / ImageBitmap | Broad modern browser support | Decoding, resizing, previewing, and exporting images | img + canvas decoding where needed |
| File API / Blob | Broad modern browser support | Local file selection and local result export | Manual save instructions if download is blocked |
| Offline Cache / SW | Broadly supported, but storage persistence can vary | Cache app shell and model assets for repeat use | Re-download model assets when storage is cleared |
The user-facing message should stay simple: BG-Zero runs locally in modern browsers. If GPU acceleration is available, it may use it; otherwise it falls back to a compatible browser path. This avoids overpromising and helps users understand why performance can differ across devices.
Client-side processing doesn't just add privacy — it eliminates entire categories of risk:
Client-side AI comes with trade-offs compared to server processing:
BG-Zero's technical architecture includes:
Technical questions about browser-based AI processing
It means the AI inference runs entirely in your web browser (the client) rather than on a remote server. Your image is processed using your device CPU/GPU via WebAssembly or WebGPU, and never leaves your machine.
All modern browsers support WebAssembly (Chrome, Firefox, Safari, Edge). WebGPU acceleration is available in Chrome 113+, Edge 113+, and experimentally in Firefox and Safari.
Yes. WebAssembly runs in a sandboxed environment within the browser. It cannot access your file system, network, or other tabs. It only processes data explicitly passed to it by the web application.
Server processing requires uploading your image, which creates privacy risks: data in transit, potential storage, possible use for training, and compliance concerns. Client-side eliminates all these issues architecturally.
If your browser supports WebGPU and BG-Zero detects a compatible GPU, yes. This accelerates processing significantly. Otherwise it falls back to CPU via WebAssembly, which is slower but still functional.
Process an image entirely in your browser — no server, no upload, no account.
Try BG-Zero