# Remove an Image Background with AI

Remove the background from people, products, animals, vehicles, and other foreground subjects locally in your browser.

## Run it

- **CLI:** `gizza tool image-background-remove-ai 'url=https://example.com/input'`
- **Web:** https://gizza.ai/tools/image-background-remove-ai/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/image-background-remove-ai/tool.json

## Inputs

- `image` — Image _(file; accept: image/png,image/jpeg,image/webp)_

## Output

- Transparent cutout (image)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `url` — fetch the input file from a public URL (CORS-permitting)

Example: `https://gizza.ai/tools/image-background-remove-ai/?url=https://example.com/input`

---

## Private image background removal

This tool uses the U-2-Netp foreground-segmentation model to isolate the main subject in an image. It works with prominent people, products, animals, vehicles, and other objects, and returns a full-resolution transparent PNG that you can place over a new color, image, presentation, product card, or design.

The model and ONNX runtime download when you first use the tool. Inference then happens inside your browser using WebGPU when available, with a WebAssembly CPU fallback. The selected image is decoded locally and is not uploaded to an AI service.

## How to get a clean cutout

Choose an image with one clear main subject and some contrast between the subject and its surroundings. Clean edges, good lighting, and an uncluttered background usually produce the best mask. Very low contrast, motion blur, heavy occlusion, transparent objects, or several equally prominent subjects can make the edge less accurate.

This is a general foreground remover, so it decides which visually dominant subject to keep. It does not let you click a particular object in a complex scene, and it is not intended to erase one object while preserving the rest of the background.

If the model finds almost no foreground, the page reports that no foreground subject was detected instead of offering an empty PNG. Try an image with a clearer subject or stronger foreground/background contrast.

## FAQ

<details>
<summary>Is my photo uploaded?</summary>

No. The model files download to the browser, but your image stays on your device and inference runs locally in the page.

</details>

<details>
<summary>Why is the first run slower?</summary>

The browser must download and initialize the pinned U-2-Netp model and shared ONNX runtime. The model itself is about 5 MB. Browser caching makes later runs much faster unless site data is cleared.

</details>

<details>
<summary>Does it work without WebGPU?</summary>

Yes. The page tries WebGPU first and falls back to WebAssembly on the CPU. The fallback is slower, particularly for large photos, but it does not require a compatible GPU.

</details>

<details>
<summary>What output format does it create?</summary>

The result is a PNG with an alpha channel. Transparent areas may appear as a checkerboard in the preview and remain transparent when downloaded.

</details>

<details>
<summary>Can it remove a product or animal background?</summary>

Yes. The model is designed to find a prominent foreground subject rather than only a person. Products and animals with distinct outlines and contrasting backgrounds work best; fine fur, reflections, transparent materials, and busy scenes can still need a more specialized editor.

</details>

## Related tools

- [Replace an Image Background (Chroma Key)](https://gizza.ai/tools/image-bg-replace/): Chroma-key a green-screen or solid-color background out and drop the subject onto a transparent, solid, or gradient background — free, in your browser.
- [Compress an Image](https://gizza.ai/tools/image-compress/): Shrink an image's file size right in your browser — re-encode a JPG, PNG, or WebP at a chosen quality, same format out. No upload to a server, runs locally, free.
- [Convert an Image](https://gizza.ai/tools/image-convert/): Convert any image to JPEG, PNG, or WebP right in your browser — pick a target format and quality. No upload to a server, runs locally, free.
- [Crop an Image](https://gizza.ai/tools/image-crop/): Crop any image right in your browser — set the x/y offset and the width/height of the rectangle to keep. No upload to a server, runs locally, free.
- [Add Film Grain to an Image](https://gizza.ai/tools/image-film-grain/): Add realistic analog film grain to a photo, right in your browser — adjustable amount, neutral or colored grain, optional format convert. Nothing is uploaded, free.
