🔄

Background Remover

Remove the background from a photo using AI-powered segmentation

GET 10 credits /v1/image/remove-background
curl "https://image.toolkitapi.io/v1/image/remove-background?url=https://toolkitapi.io/static/samples/sample-image.png&format=png&alpha_matting=false"
import httpx

resp = httpx.get(
    "https://image.toolkitapi.io/v1/image/remove-background?url=https://toolkitapi.io/static/samples/sample-image.png&format=png&alpha_matting=false",
)
print(resp.json())
const resp = await fetch("https://image.toolkitapi.io/v1/image/remove-background?url=https://toolkitapi.io/static/samples/sample-image.png&format=png&alpha_matting=false", {
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
{
  "image": "iVBORw0KGgoAAAANSUhEUg...(base64 data)...",
  "format": "png",
  "original_size": {"width": 1200, "height": 800},
  "size": {"width": 1200, "height": 800}
}

Try It Live

Live Demo

Description

Remove the background from a photo using AI-powered segmentation

How to Use

1

1. Provide the source image via the `url` query parameter.

2

2. Set `format` to png (recommended for transparency) or another format.

3

3. Enable `alpha_matting` for complex edges (hair, fur, fine detail).

4

4. The response contains the cutout image with a transparent background.

About This Tool

Use the Background Remover to automatically isolate foreground subjects and remove backgrounds from photos. It uses the rembg library with the U2-Net deep learning model for accurate segmentation of people, products, animals, and objects.

The result is a transparent PNG (or other format) with the background cleanly removed. Enable `alpha_matting` for finer edge detail on complex subjects like hair or fur, at the cost of longer processing time.

Why Use This Tool

Frequently Asked Questions

What is alpha matting?
Alpha matting is a post-processing step that refines edge detail, particularly around hair, fur, and semi-transparent areas. It produces smoother, more natural-looking cutouts but takes longer to process.
What subjects work best?
The U2-Net model works well with people, products, animals, and clearly defined objects against contrasting backgrounds. It may struggle with very complex scenes or subjects that blend into the background.
Why should I use PNG format?
PNG supports transparency (alpha channel), which is essential for background removal. JPEG does not support transparency — removed areas will appear as a solid colour.

Start using Background Remover now

Get your free API key and make your first request in under a minute.