Image Matting (Background Removal)
Free image matting API to remove image backgrounds in one call. Accepts file upload, image URL, or Base64, with a choice of general, lightweight, or portrait segmentation models. Returns a transparent cutout, a grayscale mask, or the subject composited onto a solid background. Great for product photos, ID photo backgrounds, and avatar cutouts. · E-commerce product background removal, ID photo background swapping, avatar cutout, portrait poster creation, design asset matting, batch image background processing · Image Matting (Background Removal)
free matting API, background removal API, remove background, image cutout API, auto matting, ID photo background, product photo matting, portrait matting, image matting api, remove background api, transparent background image, online cutout
POST /image/matting - Image Matting (Background Removal)
Still tracing outlines with the lasso tool one click at a time? Or want to add one-click ID-photo background swapping to your app? This API automatically detects the subject in an image and strips away complex backgrounds in an instant.
Feature Overview
Just provide an image, and the API runs a powerful segmentation model in the cloud and returns the processed result directly. It supports a high degree of customization, letting you:
- Choose a segmentation model (model): Depending on the image type, switch freely between general-purpose, lightweight-fast, portrait-specific, and sharper-edge models.
- Customize the output (output): By default, you get a clean transparent-background subject image (cutout). For further design work, you can also get a grayscale alpha mask (mask), or composite the subject directly onto a specified solid background (background).
- Fine-tune the edges: threshold (binarize away semi-transparency) and featherpx (Gaussian feathering) let you refine the cutout edges for a more natural blend.
Usage Notes
Mutually exclusive image inputs: to avoid conflicts, choose exactly one of file, url, or imagebase64.
Output format restriction: if you request jpeg as the output format, since JPEG doesn't support an alpha channel, you must also set output=background, otherwise the request will fail.
Size limit: each uploaded image is capped at 16MB.