Browser-only background removal needs an ML model. Reference integrations below for production.
Why not in-browser?
Quality background removal requires a 100MB+ ML model. We recommend a hosted service or running rembg locally.
import { removeBackground } from "@imgly/background-removal";
const blob = await removeBackground(imageUrl);
const url = URL.createObjectURL(blob);pip install rembg
rembg i input.jpg output.png
# Batch:
rembg b -i input_dir -o output_dirconst url = `https://res.cloudinary.com/CLOUD/image/upload/e_background_removal/${publicId}`;