Quick start: remove a background in under a minute
- Upload — Drop a JPEG, PNG, or WebP photo (up to ~20 MB). Larger files are auto-scaled before inference.
- Wait for inference — ONNX Runtime Web runs the U²-Net model locally. First visit downloads ~10 MB; after that, cached.
- Download — Export a full-resolution transparent PNG. No watermark, no size cap.
The stack: @imgly/background-removal + ONNX Runtime Web + U²-Net
This tool runs the open-source @imgly/background-removal library compiled to WebAssembly, powered by ONNX Runtime Web — the same runtime family used in production ONNX deployments. Instead of uploading your photo to a cloud API, a U²-Net variant segmentation model (~10 MB) downloads once to your browser cache and classifies every pixel locally: foreground subject vs. background.U²-Net (U-squared Net, 2020) uses a nested U-Net architecture — smaller U-Net blocks inside larger ones — to capture both fine edge detail and global scene context in a single pass. It was trained for salient object detection: finding the most visually prominent subject and producing a pixel-accurate alpha mask.
What happens during inference
| Stage | What runs | Where |
|---|---|---|
| 1. Decode | Browser decodes JPEG/PNG/WebP into a raw pixel buffer | Main thread |
| 2. Pre-process | Image is resized if needed; normalised for model input | Web Worker |
| 3. ONNX inference | U²-Net model classifies each pixel (foreground vs background) | WebGL or WASM via ONNX Runtime Web |
| 4. Post-process | Segmentation mask is smoothed and composited onto transparent canvas | Web Worker |
| 5. Export | Canvas exports lossless PNG with full alpha channel | Main thread |
No stage sends image data to a network endpoint. The only network call on first load is downloading the cached ONNX model file.
Input formats and practical limits
| Format | Supported | Notes |
|---|---|---|
| JPEG | Yes | Best for photos; no alpha in source |
| PNG | Yes | Preserves source quality; transparency in source is ignored (model segments subject) |
| WebP | Yes | Lossy and lossless WebP both work |
| GIF | No | Animated frames not supported in current build |
Files up to ~20 MB process smoothly. Larger images are downscaled before inference to keep processing under ~8 seconds on mid-range hardware.
Cloud vs on-device: why it matters
| Cloud (remove.bg, etc.) | PDFBucket (this tool) | |
|---|---|---|
| Privacy | Your photo leaves your device | Zero upload during processing |
| Speed | Upload + queue + download | Inference only — no network wait |
| Resolution | Free tiers often cap output | Full native resolution |
| Model | Proprietary server-side | U²-Net via ONNX Runtime Web |
Because inference runs in your browser tab, this is the right choice when the photo contains faces, confidential product designs, or sensitive documents.
Common workflows
E-commerce product listings: Amazon, Etsy, and Shopify require clean white or transparent backgrounds. Remove the background here, then composite onto white — or upload the transparent PNG directly if your platform supports it.Professional headshots: Replace a cluttered office background with a solid brand colour or neutral blur for LinkedIn, ID cards, or speaker bios.
Design and collage work: Extract subjects from reference photos for mockups, presentations, and social graphics without opening Photoshop.