Learn-skills.dev image-remove-background
Removes the background from an image, leaving the foreground subject with transparency. Use when you need to isolate subjects, create cutouts, or prepare images for compositing.
install
source · Clone the upstream repo
git clone https://github.com/NeverSight/learn-skills.dev
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/agntswrm/agent-media/image-remove-background" ~/.claude/skills/neversight-learn-skills-dev-image-remove-background && rm -rf "$T"
manifest:
data/skills-md/agntswrm/agent-media/image-remove-background/SKILL.mdsource content
Image Remove Background
Removes the background from an image, leaving only the foreground subject with transparency.
Command
agent-media image remove-background --in <path> [options]
Inputs
| Option | Required | Description |
|---|---|---|
| Yes | Input file path or URL |
| No | Output path, filename or directory (default: ./) |
| No | Provider to use (local, fal, replicate) |
Output
Returns a JSON object with the processed image path:
{ "ok": true, "media_type": "image", "action": "remove-background", "provider": "fal", "output_path": "nobg_123_abc.png", "mime": "image/png", "bytes": 34567 }
Examples
Remove background from local file:
agent-media image remove-background --in portrait.jpg
Remove background using specific provider:
agent-media image remove-background --in portrait.jpg --provider replicate
Providers
local
Runs locally on CPU using Transformers.js, no API key required.
- Uses
modelXenova/modnet - Models downloaded on first use (~25MB)
- You may see a
error — ignore it, the output is correct ifmutex lock failed"ok": true
agent-media image remove-background --in portrait.jpg --provider local
fal
- Requires
FAL_API_KEY - Uses
modelbirefnet/v2
replicate
- Requires
REPLICATE_API_TOKEN - Uses
modelbirefnet