peterkrueck/claude-code-development-kit/bg-remove
Claude Code and agent skill by peterkrueck/claude-code-development-kit
- community
Checking that the SKILL.md file is still in the repository.
Remove backgrounds from images using local AI (rembg). Use when removing backgrounds from character art, mascot images, photos, or any image that needs a transparent background.
Install
npx vskill@latest install peterkrueck/claude-code-development-kit/bg-removeSKILL.md
The same SKILL.md was published earlier as peterkrueck/claude-code-development-kit/bg-remove.
Background Remove — Local AI Background Removal
Remove backgrounds from images using rembg (local, offline, no data sent externally). Outputs RGBA PNG with proper transparency.
Input
Arguments after /bg-remove:
- Source image path (required) — path to the image
- `--trim` (optional) — auto-trim transparent padding after removal
- `--output <path>` (optional) — custom output path. Default: same directory,
<name>-transparent.png
Examples:
/bg-remove assets/character/mascot.png/bg-remove image.png --trim/bg-remove image.png --output ~/Desktop/result.png
Setup
rembg is installed in a dedicated venv. Always activate it before use:
If the venv doesn't exist, install it:
Model files are cached in ~/.u2net/ (downloaded on first use per model, ~170MB for birefnet-general).
Process
Step 1: Verify Input
- Check the source image exists
- Get dimensions:
sips -g pixelWidth -g pixelHeight <path> - View the image with the Read tool to understand what we're working with
Step 2: Remove Background
Use the birefnet-general model — validated in testing on illustrated/character art and general photos, producing clean edges across both.
Model choice: Default to birefnet-general. In side-by-side testing it gave clean edges on both illustrated subjects and photographic ones. Avoid anime-trained models (e.g. isnet-anime): on non-anime and even some illustrated inputs they tend to add artifacts and leave dark patches around edges. If birefnet-general underperforms on a specific image, compare against another general model rather than an anime-specific one.
Step 3: Verify Result
The Read tool renders transparency as black, so you MUST verify by compositing on a colored background:
Then view the magenta verification image with the Read tool. The magenta should only show where background was removed.
Step 4: Optional Trim
If --trim was requested, trim transparent padding:
Step 5: Report
Verify before shipping: open the output in Preview.app (or any viewer that shows the checkerboard pattern) to confirm real transparency. The Read tool renders transparency as solid black, so it cannot distinguish a transparent background from a black one — composite-over-a-color (Step 3) or a checkerboard viewer is the only reliable check.
Important Rules
- Default to `birefnet-general` — in side-by-side testing it produced the cleanest edges on both illustrated and photographic inputs; anime-trained models added artifacts. Only switch models if it visibly underperforms on a specific image.
- Always activate the venv before running rembg or Python with Pillow/numpy.
- Always verify with magenta composite — don't trust the Read tool's rendering of transparency.
- Never send images to external services — rembg runs 100% locally.
- Preserve original files — output to a new file, never overwrite the source.
- Clean up verification images — delete the magenta composite after confirming quality.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/bg-remove/SKILL.md
Popularity
- Repository stars
- 1,356
- Repository forks
- 156
- 7-day trend score
- 36
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 5 Jul 2026, 4 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/peterkrueck/claude-code-development-kit/bg-remove)