opencoredev/bg0

Private, unlimited background removal that runs in your browser.

What it solves

BG0 provides a way to remove image backgrounds locally in the browser, eliminating the need to upload images to a server, manage API keys, or deal with usage limits and billing.

How it works

The tool uses a pinned BiRefNet ONNX model that is downloaded and cached locally in the browser. It leverages WebGPU for acceleration when available, falling back to WebAssembly (WASM) for inference. The process includes preprocessing, ONNX inference, mask postprocessing, and alpha compositing to produce a transparent PNG.

Who it’s for

Developers who want to integrate private, client-side background removal into their web applications via the @bg0/browser library, as well as general users who need a privacy-focused background remover.

Highlights

  • Local browser-based inference: No server-side processing or data upload required.
  • Hardware acceleration: Uses WebGPU with a WASM fallback.
  • Reusable library: Includes a dedicated package for easy integration into other web apps.
  • Privacy-first: Images and pixels stay in browser memory.

Related

  • Project
  • Project
  • Project
  • Project