How the background remover works
The browser decodes the selected image, resizes a working copy for the segmentation model, and predicts which pixels belong to the main foreground subject. That mask is resized to the original dimensions and applied as an alpha channel, preserving the original RGB pixels in a transparent PNG.
transparent pixel = source pixel × foreground alpha maskThe segmentation model estimates a foreground mask from 0 (transparent) to 1 (opaque) for each pixel.
Remove the background from a product or portrait image
Select a supported image, start removal, and wait for the first-use model download and local processing. The preview displays transparency as a checkerboard. Downloading saves the original dimensions as a PNG with an alpha channel.
Using the transparent PNG
Preserve the PNG alpha channel and provide accurate dimensions and alternative text when adding the result to a page.
<img src="subject-no-background.png" width="1200" height="800" alt="Product shown without its original background">.transparent-preview {
background-color: #fff;
background-image:
linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
linear-gradient(-45deg, #e5e7eb 25%, transparent 25%);
}Using the result accurately
Use a clearly defined foreground subject, adequate lighting, and visible separation between subject and background. Inspect hair, fur, glass, shadows, and similarly colored edges at full size before using the result in production.
Automatic segmentation can remove fine foreground detail or retain parts of a complex background. Processing speed depends on the device, browser, image dimensions, model cache, and available memory. The tool does not provide manual mask correction.
References: Hugging Face ONNX Community: ORMBG background-removal model.