The Model: U2-Net and ONNX Runtime Web
PDFBucket's Background Remover runs a U2-Net-based salient object detection model, compiled to ONNX format and executed locally via ONNX Runtime Web.U2-Net (U-squared Net, 2020) was designed specifically to detect the most visually prominent object in an image and generate a pixel-accurate segmentation mask. It uses a nested U-Net architecture — U-Net layers inside larger U-Net layers — that captures both fine edge detail and global context simultaneously. This is why it handles challenging edges like flyaway hair, transparent glasses frames, and soft fur much better than older threshold-based approaches.
ONNX Runtime Web is a JavaScript library that compiles neural network models to run in the browser using WebGL (GPU acceleration where available) or WASM (CPU fallback). The model runs inference on your device — no cloud API call, no image upload.
When It Works Best
Ideal inputs:- Portraits with clear separation between subject and background
- Product shots with decent contrast against the background
- Animals with clear outlines
- Objects on a single-color or simple-pattern background
- Very low contrast (white subject on white background)
- Extreme backlighting where the subject is mostly in silhouette
- Very busy, high-texture backgrounds similar in color to the subject
Getting Better Results from Difficult Images
Pre-crop the image. If the subject takes up less than 30% of the frame, crop closer before uploading. The segmentation model focuses on the most salient object — giving it more context improves mask accuracy.Increase contrast. If your source image is flat or low-contrast, run the exposure and contrast up slightly before background removal. More tonal separation gives the model clearer edges to segment.
Check the alpha at 100% zoom. After downloading the transparent PNG, open it against a dark background to inspect edges. Fine hair or fur that was not perfectly masked usually shows as a faint fringe. For print-quality work, manual cleanup in Photoshop or GIMP using the Refine Edge tool will get you to professional results.