Home/Blog/Image Tools
Image Tools10 min readSeptember 15, 2026

AI Background Remover — Best Practices for Clean Results

Get the best results from AI background removal. Learn which photos work best, how the U2-Net model handles edges, and how to refine outputs.

👨‍💻
Jeeva
Founder & Developer, PDFBucket

!image compression

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:

    1. Portraits with clear separation between subject and background
    2. Product shots with decent contrast against the background
    3. Animals with clear outlines
    4. Objects on a single-color or simple-pattern background
Challenging inputs:
    1. Very low contrast (white subject on white background)
    2. Extreme backlighting where the subject is mostly in silhouette
    3. 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.

Try it for free — right now

No signup. No limits. All tools run in your browser.

Use Free Tools ↗

FAQs about Image Tools

Everything you might be wondering — answered.

Which AI model does PDFBucket's background remover use?+
It uses a U2-Net-based segmentation model compiled to ONNX format and executed via ONNX Runtime Web in your browser. The model is ~10 MB and caches after first load.
Why does it take a few seconds on first use?+
The ~10 MB ONNX model file downloads and caches in your browser on first use. Subsequent uses load from cache in under a second.
Does it work on product photos with white backgrounds?+
Results vary. White-background product photos with a distinct subject usually work well. Very low-contrast subjects (a white shirt on a white background) are harder for the model to segment accurately.

More Guides

OCR

OCR for Receipts and Invoices — How to Extract Data Accurately

Read →

Social Media

Complete Guide to Social Media Image Sizes (2026 Edition)

Read →

Guides

WebP vs JPEG vs PNG vs AVIF — Which Format Should You Use?

Read →