---
name: background-remove-batch
description: Remove backgrounds from many images with Kenerate remove_background (cutout, cutout-hd for hair / glass, extract one object), then composite every cut-out onto brand colours, gradients or a backdrop image with consistent padding, a soft contact shadow and any output size, plus a grid preview. Use when the user wants transparent PNGs, background removal in bulk, product or headshot cut-outs on brand colours, consistent catalogue images or team photos on one background.
compatibility: Needs the Kenerate MCP server and Python 3.9+ with Pillow (ffmpeg not needed).
metadata:
  author: kenerate
  version: "1.0"
  kenerate-tools: "upload_media remove_background generate_image estimate_cost wait_for_generation"
---

# Background remove (batch) + brand backgrounds

Rules: [references/KENERATE.md](references/KENERATE.md) (models and voices: [references/MODELS.md](references/MODELS.md), or the free `pick_model` / `pick_voice` tools).

## Ask the user
The images, the subject type (product, person, pet, glass / hair = HD), the backgrounds (brand hex colours, a gradient,
or a scene to generate) and the output size (1080x1080, 1080x1350, ...).

## 1. Cut-outs (Kenerate)
For each image: `remove_background(image_url=<img>, mode="cutout")`. Use `cutout-hd` for hair, fur, glass or smoke;
`mode="extract", keep="<the thing>"` when there are several objects. cutout is the cheapest mode; give the count and
price, confirm, start all, then `wait_for_generation("remove-bg", id)` for each.
Optional backdrop: `generate_image(prompt="empty studio backdrop, soft gradient, <brand colours>, no objects", aspect_ratio=<output ratio>)`.

## 2. Composite (local)
```
python <skill-dir>/scripts/composite.py --cutouts "<png url 1>" "<png url 2>" \
  --bg "#FF5A1F" --bg "gradient:#0F172A,#7C3AED" --bg "image:<backdrop url>" \
  --size 1080x1350 --padding 0.12 --align bottom --shadow soft --name <project> \
  --out-dir kenerate-out/background-remove-batch
```
- Every cut-out x every `--bg` gives `<project>_01_bg1.png`, … plus `<project>_grid.jpg` (show it) and a report.
- `--align bottom` stands products on a floor; `center` suits logos and avatars. `--shadow soft|hard|none`.
- The transparent PNGs themselves are in the Kenerate results. Download them with
  `python <skill-dir>/scripts/kmedia.py fetch --out kenerate-out/background-remove-batch/cutouts <urls>`.

## If something fails
"has no transparency" → that image wasn't cut out (or the cut-out failed). Failed jobs are refunded; retry with
`cutout-hd` or `extract` on approval.
