Loading...
Loading...
Remove backgrounds from images using AI. Triggers include: "remove background", "transparent background", "cut out", "isolate subject", "remove bg", "make transparent", "extract subject", "background removal" Creates PNG or WebP images with transparent backgrounds.
npx skill4agent add michaelboeding/skills background-remove| User Says | What Happens |
|---|---|
| "Remove the background from this photo" | AI removes background, outputs PNG |
| "Make this image transparent" | Removes background, preserves subject |
| "Cut out the product from this image" | Isolates subject with clean edges |
| "Remove backgrounds from all images in /photos" | Batch processes multiple images |
| "Quick background removal, white background" | Uses fast built-in method |
rembgpip install rembg
# Or with GPU acceleration (faster, requires CUDA)
pip install rembg[gpu]Pillowpip install Pillow| Method | Description | Best For |
|---|---|---|
| rembg | AI-based using U2-Net model | Complex images, photos, products (default) |
| builtin | White-to-transparent conversion | Icons, graphics with clean white backgrounds |
AskUserQuestion"Which image(s) should I remove the background from?Please provide the file path or paste the image."
"Which removal method?
- AI (rembg) - Best quality, works on any image (default)
- Built-in - Faster, best for white backgrounds"
"Where should I save the result?
- Same location with
suffix (default)_nobg- Custom path"
python3 ${SKILL_PATH}/skills/background-remove/scripts/background_remove.py \
-i "/path/to/image.jpg" \
-o "/path/to/output.png"python3 ${SKILL_PATH}/skills/background-remove/scripts/background_remove.py \
-i "/path/to/img1.jpg" "/path/to/img2.png" "/path/to/img3.webp" \
-o "/path/to/output_folder"python3 ${SKILL_PATH}/skills/background-remove/scripts/background_remove.py \
-i "/path/to/icon.png" \
-m builtin| Parameter | Short | Description | Default |
|---|---|---|---|
| | Input image path(s) | Required |
| | Output path or directory | Auto-generated with |
| | Removal method (rembg, builtin) | rembg |
| Extension | Format | Notes |
|---|---|---|
| PNG | Best quality, larger file (default) |
| WebP | Good compression, modern format |
import sys
sys.path.insert(0, "${SKILL_PATH}/skills/background-remove/scripts")
from background_remove import remove_background
result = remove_background("/path/to/image.png", "/path/to/output.png", method="rembg")
if result.get("success"):
print(f"Saved to: {result['file']}")
else:
print(f"Error: {result['error']}")python3 ${SKILL_PATH}/skills/background-remove/scripts/background_remove.py \
-i "/path/to/image.png" \
-o "/path/to/output.png" \
-m rembgrembg not installed. Install with: pip install rembg[gpu] (or pip install rembg for CPU-only)Image not found: /path/to/image.pngrembg[gpu]python3 ${SKILL_PATH}/skills/background-remove/scripts/background_remove.py \
-i "product_photo.jpg" \
-o "product_transparent.png"python3 ${SKILL_PATH}/skills/background-remove/scripts/background_remove.py \
-i photos/*.jpg \
-o "transparent_photos/"python3 ${SKILL_PATH}/skills/background-remove/scripts/background_remove.py \
-i "icon.png" \
-m builtinpython3 ${SKILL_PATH}/skills/background-remove/scripts/background_remove.py \
-i "photo.jpg" \
-o "result.webp"