Background Remover
Remove the background from a photo using AI-powered segmentation
/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
{
"image": "iVBORw0KGgoAAAANSUhEUg...(base64 data)...",
"format": "png",
"original_size": {"width": 1200, "height": 800},
"size": {"width": 1200, "height": 800}
}
Try It Live
Description
How to Use
1. Provide the source image via the `url` query parameter.
2. Set `format` to png (recommended for transparency) or another format.
3. Enable `alpha_matting` for complex edges (hair, fur, fine detail).
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
- E-commerce — Remove backgrounds from product photos for clean catalog images
- Profile pictures — Create transparent avatars from portrait photos
- Design workflows — Extract subjects for compositing onto new backgrounds
- Marketing materials — Isolate products for banners, ads, and social media
- Passport photos — Remove backgrounds for ID-style photo requirements
Frequently Asked Questions
What is alpha matting?
What subjects work best?
Why should I use PNG format?
Start using Background Remover now
Get your free API key and make your first request in under a minute.