Background Remover

Strip image backgrounds with BiRefNet running locally in your browser. PNG with alpha or solid color replacement.

published

  • [FREE]
  • [NO_SIGNUP]
  • [NO_UPLOAD]

A background remover isolates the subject of a photo and removes the rest. This tool runs a segmentation neural network inside your browser via transformers.js and ONNX Runtime Web — no upload, no API key, no per-image cost.

How it works

  1. You drop an image into the tool.
  2. The first time, transformers.js downloads the selected model from Hugging Face — 6.6 MB for Portrait (MODNet) or 114 MB for General (BiRefNet lite). Cached after that.
  3. The image is decoded by the browser, fed into ONNX Runtime Web (whose WASM is served from bytefork.tools, not a CDN), and passed through the segmentation network.
  4. The model outputs an alpha mask predicting which pixels are subject vs background.
  5. The browser composites the original image with the predicted alpha and either outputs a transparent PNG or flattens against your chosen background color.

The whole pipeline runs in your browser tab. Open DevTools → Network and watch: model download once, image inference never makes a request with your photo.

When it works well

  • Product photos — clear subject, white or simple background.
  • Portraits — well-lit faces, separable from background (cluttered restaurants are harder).
  • Animals — fur edges are usually clean unless they blend into the background.
  • Logos / mockups — vector-like subjects with hard edges.

When it struggles

  • Fine hair detail — wisps and strands often disappear or get halos. Both models handle this well but not perfectly.
  • Translucent objects — glass, water, smoke don’t have a binary mask.
  • Motion blur — the model expects sharp subject edges.
  • Low-contrast pairs — white shirt on white wall, black cat on black sofa.
  • Reflections — the model treats reflections as background and removes them.

If a result looks bad, try cropping tighter to the subject before processing.

Privacy

Static HTML page → small JavaScript bundle → transformers.js → ONNX Runtime Web → segmentation model — all running in your browser tab. The Network tab in DevTools shows what gets fetched: the bundle, the runtime from this origin, and the model weights from Hugging Face. Your image is never in those requests.

The model download contains zero personal data. It’s just the neural network weights, the same ones any other user of that model would download.

How it compares

bytefork.toolsremove.bgclipdrop.co
Runs in browser✗ (uploads)✗ (uploads)
Privacy: image stays local
Sign-in requiredfor HD outputfor batches
Costfree, unlimited$0.20-$1.99/image (after 1 free)subscription
Output resolutionsource resolution (no cap)0.25 MP free; HD paid1 MP free; HD paid
Hair-detail accuracyvery good (MODNet / BiRefNet)excellent (proprietary)very good
Translucent handlinglimitedbest-in-classgood
Ad-free

Tips

  • Crop tight before uploading. Less background = better focus for the model.
  • Use high-resolution sources. Output stays at the source resolution.
  • For solid-color backgrounds, pick the Color mode and try different colors instantly — no re-processing needed.
  • For batch jobs, keep the tab open between images. The model stays in memory after the first download.

Frequently asked questions

How does this work without uploading my image?

It uses transformers.js (Apache-2.0) to run a segmentation neural network inside the browser via ONNX Runtime Web. Two models are available: Portrait (MODNet, Apache-2.0, 6.6 MB) for people, and General (BiRefNet lite, MIT, 114 MB) for any subject. Weights download once from Hugging Face and stay cached by your browser; the ONNX Runtime WASM is served from bytefork.tools itself. After that first download, every removal happens entirely in your browser tab — the image bytes never leave your device.

How accurate is it?

For clear subjects on contrasting backgrounds (product photos, portraits with separable hair, animals against sky), accuracy approaches commercial cloud services like remove.bg. For complex hair detail, transparent objects (glass, water), motion blur, or low-contrast subject/background pairs, results may show halos or missing edges. Portrait uses MODNet, which is tuned specifically for people; General uses BiRefNet lite, which handles arbitrary subjects. Both are strong for browser-side segmentation, neither is magic.

Why does the first run take so long?

The first run downloads the model. Portrait is 6.6 MB — a second or two on broadband. General is 114 MB, roughly 20–30 seconds on a fast connection and longer on a slow one. After that the model lives in your browser cache and the second run jumps straight to inference (2–10 seconds for a typical photo). If you are cutting out a person, stay on Portrait and you never pay the large download.

Does this support batch processing?

Not in this version — one image at a time. Batch is on the roadmap; for now, drop each image into the tool one by one.

What image formats are supported?

Input: PNG, JPG, WebP. Output: PNG with an alpha channel (transparent background) or PNG composited on a solid color you pick.

Why is the output always PNG?

PNG is the only widely-supported format that handles alpha transparency without artifacts. JPG has no alpha and would force you to flatten against a chosen color (which you can do explicitly via the Color mode). WebP supports alpha but support is uneven in older toolchains.

Can I use this commercially?

Yes, and the whole stack is permissively licensed with no commercial tier to buy. bytefork.tools is MIT. transformers.js is Apache-2.0 and ONNX Runtime Web is MIT. The model weights — the layer that usually carries the restriction — are permissive too: MODNet is Apache-2.0, with its author's README explicitly extending the grant to the models, and BiRefNet is MIT. This tool deliberately avoids the popular RMBG-1.4 and RMBG-2.0 weights, which are non-commercial (CC BY-NC 4.0 / Bria's own licence), and IS-Net, whose Apache-2.0 tag covers only "code and evaluation metric" while its DIS5K training data is non-commercial.

Compared with remove.bg — when should I use this?

Use this when privacy matters (your image never leaves your device), when you need to process many images without paying per credit, and when you're OK with browser-side accuracy. Use remove.bg when you need their tuned pro model for edge cases (very fine hair, complex translucent objects). For most everyday use, the difference is small enough that the privacy + zero-cost trade is the right one.

Why does this page show a "CSP relaxation" disclaimer?

ONNX Runtime Web — the inference engine that runs the background-removal neural network — JIT-compiles its tensor kernels using `new Function()`. That requires `unsafe-eval` in the page's Content Security Policy. Every other tool on bytefork.tools runs under a strict CSP that forbids `eval()` and `new Function()`. We scoped the relaxation to this one URL using a per-path `Content-Security-Policy` header in public/_headers — you can verify in DevTools → Network → response headers that the CSP only differs here. Practical risk is low because the site never accepts user-submitted scripts; the additional eval surface has no inputs to exploit. If you prefer not to run a page with `unsafe-eval`, skip this tool.

Is the tool really free?

Yes. No signup, no usage limit, no watermark, no ads. The model download is the only "cost" — and it's a one-time, no-data-leaked transfer.