How does local background removal work?
Background removal uses an image-segmentation model to estimate which pixels belong to the foreground subject and outputs an image with the predicted background made transparent. It works best when the subject has clear visual separation and can struggle with hair, glass, shadows, fine edges, or similar foreground and background colors.
The @imgly/background-removal ONNX model runs through WebAssembly on the device after a 40–80 MB model download that can be cached. JPEG and PNG inputs are processed without uploading the image. First use may be slow, and output should be inspected at full size before production use.