skills/image-remove-background/SKILL.md
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.
npx skillsauth add agntswrm/agent-media image-remove-backgroundInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Removes the background from an image, leaving only the foreground subject with transparency.
npx agent-media@latest image remove-background --in <path> [options]
| Option | Required | Description |
|--------|----------|-------------|
| --in | Yes | Input file path or URL |
| --out | No | Output path, filename or directory (default: ./) |
| --provider | No | Provider to use (local, fal, replicate) |
| --resolution | No | Output resolution (e.g., "2048x2048"). Supported by fal Dynamic model. |
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
}
Remove background from local file:
npx agent-media@latest image remove-background --in portrait.jpg
Remove background using specific provider:
npx agent-media@latest image remove-background --in portrait.jpg --provider replicate
Remove background at full resolution (fal Dynamic model):
npx agent-media@latest image remove-background --in portrait.jpg --provider fal --resolution 2048x2048
Runs locally on CPU using Transformers.js, no API key required.
Xenova/modnet modelmutex lock failed error — ignore it, the output is correct if "ok": truenpx agent-media@latest image remove-background --in portrait.jpg --provider local
FAL_API_KEYbirefnet/v2 model with General Use (Dynamic) variant--resolution option (e.g., "2048x2048") for processing at full input resolutionREPLICATE_API_TOKENbirefnet modeldata-ai
Generates video from text prompts or animates static images. Use when you need to create videos from descriptions, animate images, or produce video content using AI.
development
Upscales an image using AI super-resolution to increase resolution with detail generation. Use when you need to enlarge images, improve low-resolution photos, or prepare images for large-format display.
testing
Resizes an image to specified dimensions. Use when you need to change image size, create thumbnails, or prepare images for specific display requirements.
data-ai
Generates an image from a text prompt using AI models. Use when you need to create images from descriptions, generate artwork, or produce visual content from text.