Under the hood
How it works
From drag-and-drop to a perfect transparent PNG — here’s everything that happens, and why it matters.
The pipeline
- 1
Upload and decode
Your image is read locally — never transmitted. Magic-byte validation confirms the file type before processing. HEIC images (iPhone) are converted using a local WebAssembly decoder. For images over 4096 × 4096 px, a downscale copy is made for inference while the full-resolution original is retained for export.
- 2
On-device AI inference
The neural network runs entirely in your browser via Transformers.js. On supported hardware, WebGPU executes the model on your GPU (2–5 s typical). Otherwise, multi-threaded or single-threaded WebAssembly is used as fallback. Two models are available: RMBG-1.4 for speed, RMBG-2.0 for maximum detail on hair, fur, and complex edges.
- 3
High-precision Float32 mask
The AI outputs a Float32 alpha mask — not a binary cutout. Every pixel keeps a precise opacity value between 0.0 and 1.0, preserving soft edges, semi-transparent areas, and fine strands. The mask is then upscaled back to your original resolution using bilinear and bicubic interpolation.
- 4
Edge decontamination
A common artifact is color spill — where the background color bleeds into edge pixels. An automatic Lab colorspace decontamination pass pushes semi-transparent edge pixels toward the foreground color, without touching solid foreground areas.
- 5
Export with straight alpha
The final RGBA composition uses straight (non-premultiplied) alpha. The RGB of transparent pixels is preserved — never set to black or zeroed out. After encoding, we decode the export and sample edge pixels to confirm alpha integrity automatically.
Why your PNG might show black in Photoshop — and how we fix it
Every transparent image stores a color component (RGB) and an opacity component (alpha) for each pixel. Straight alpha stores these independently. Premultiplied alpha bakes the background color into the RGB values — at 0% opacity the RGB becomes fully black (0, 0, 0).
Most free tools export premultiplied alpha because it’s simpler. The file appears correct in a web browser (which handles it automatically), but in Photoshop, Figma, After Effects, or any professional tool you see black halos around the subject.
NSS never premultiplies. The final alpha write is always Math.round(maskValue × 255) applied to the original RGB — not a reconstruction. Pixels at 0% opacity keep their original RGB intact. This is validated automatically after every export.
Complete privacy by design
NSS Background Remover has no backend image processing server. There is no API call that sends your image anywhere. The AI models download once and cache in your browser — subsequent uses work offline.
The app is built as a Progressive Web App with a service worker that caches the application shell and model weights locally. Once loaded, background removal requires no internet connection.
The AI models
RMBG-1.4 — Fast mode
by BRIA AI · ~80 MB download
A lightweight salient object detection model. Excellent for product images, portraits, and subjects with clean edges. Inference: 2–5 s on WebGPU, 8–15 s on WebAssembly.
RMBG-2.0 — Best Quality mode
by BRIA AI · ~180 MB download
A bilateral reference network for fine-grained edge detail — hair, fur, transparent objects, and complex boundaries. Recommended when quality matters most.
Models load from Hugging Face via Transformers.js and are cached locally after the first download.