remove-bg

remove-bg is a skill for Claude Code, Codex from ZJU-REAL/Easel. It costs 168 tokens per session (1,004 once invoked), scanned A, original, Apache-2.0.

An image-editing skill that removes a picture's background and saves the subject as a transparent PNG, a solid-colour image, or a new scene.

In plain words
What is it for?
It helps prepare product photos, portraits, white-background ecommerce images, and images placed into different scenes.
Why use it?
It removes the need to manually trace around people or products, and it works without a green screen.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python skills/shared/scripts/remove_bg.py check.

Good fit It helps prepare product photos, portraits, white-background ecommerce images, and images placed into different scenes.

Compare 6 skills from other repositories ↓
About the project

Easel is an open-source content workspace and AI agent for managing social media from trend discovery through planning, content creation, publishing, and performance analysis. It is intended for social media creators and maintains separate account profiles, content projects, platform adaptations, and publishing records. The catalogue skills support these content and publishing workflows.

ZJU-REAL/Easel · 5,054 stars · on GitHub · zju-real.github.io

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/ZJU-REAL/Easel
agentmods
npx agentmods add skills/zju-real/easel/remove-bg

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for remove-bg

README.md
[![agentmods](https://agentmods.dev/badge/skills/zju-real/easel/remove-bg/github.svg)](https://agentmods.dev/skills/zju-real/easel/remove-bg)
Your own site
<a href="https://agentmods.dev/skills/zju-real/easel/remove-bg"><img src="https://agentmods.dev/badge/skills/zju-real/easel/remove-bg/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for remove-bg

Your own site · 80×15
<a href="https://agentmods.dev/skills/zju-real/easel/remove-bg"><img src="https://agentmods.dev/badge/skills/zju-real/easel/remove-bg.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 168 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,004 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00168 $0.01004
Opus 5.5 $0.00067 $0.00402
Sonnet 5.5 $0.00034 $0.00201
Haiku 4.5 $0.00017 $0.00100

Measured 3mo ago against content hash 6a5d23ee1f2c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

remove-bg scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/builtin/remove-bg/SKILL.md · 81 lines

What it actually says

图片去背景 / 抠图换背景

用 rembg(AI 语义分割)把主体抠出,输出透明 PNG 或换新背景。无需绿幕。全部走 skills/shared/scripts/remove_bg.py。

绿幕视频抠像见 green-screen;电商视觉方案见 ecom-details-image; 常规缩放/裁切/水印见 image-editing。

前置

首次运行自动下载模型(~4-170MB,视模型而定),需外网代理(脚本读 EASEL_PROXY/http(s)_proxy,未设则直连)。先自检:

python skills/shared/scripts/remove_bg.py check

输入

字段 必填 说明
图片 是 要抠图的图片(没给就问)
输出背景 否 透明(默认)/ 纯色 / 换图片背景
模型 否 通用 / 人像 / 精细,见下表

输出(outputs/主题名/)

  • 抠好的图片(透明用 .png)
  • 报告:所用模型、背景形态

执行步骤

脚本路径(相对项目根):skills/shared/scripts/remove_bg.py(remove -h 看参数)。

# 透明背景(务必输出 .png)
python skills/shared/scripts/remove_bg.py remove -i product.jpg \
  -o outputs/主题名/cutout.png

# 电商白底主图
python skills/shared/scripts/remove_bg.py remove -i product.jpg \
  -o outputs/主题名/white.jpg --bg-color white

# 换新场景背景
python skills/shared/scripts/remove_bg.py remove -i person.jpg \
  -o outputs/主题名/scene.png --bg-image scene.jpg

# 人像 + 毛发边缘细腻
python skills/shared/scripts/remove_bg.py remove -i portrait.jpg \
  -o outputs/主题名/cut.png --model u2net_human_seg --alpha-matting

模型选择

模型 适用
u2net(默认) 通用主体
u2netp 轻量快速(质量略低)
u2net_human_seg 人像专用
isnet-general-use 更精细的通用分割
silueta 体积小的通用模型

抠不干净/边缘毛糙时:换更精细的模型,或加 --alpha-matting(慢但边缘更好,适合头发/毛绒)。

规则

  1. 要透明背景必须输出 .png(jpg 不支持透明,脚本会自动改白底并提示)。
  2. 电商主图用 --bg-color white;换场景用 --bg-image(自动等比覆盖裁切)。
  3. 人像优先 u2net_human_seg,商品/通用用 u2net。
  4. 抠图质量取决于主体与背景对比度;复杂/低对比图无法保证完美。
  5. 产物统一进 outputs/主题名/。

参考来源

去背景用 rembg(u2net 系列显著性目标检测/分割模型)+ onnxruntime CPU 推理,是无 GPU 抠图的 主流方案。换背景合成用 Pillow alpha_composite。把模型加载、代理注入、背景合成封装成确定性脚本。

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 81 lines · 168 tokens per session scan A 6a5d23ee1f2c

Subscribe to this mod's changes

remove-bg is a skill published in the GitHub repository ZJU-REAL/Easel (5,054 stars, last pushed 3d ago), licensed Apache-2.0. It adds 168 tokens to every session and 1,004 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

remove-bg compared with skills from other repositories

remove-bg next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
remove-bgZJU-REAL/EaselSkill5.1k3d agoApache-2.0A168Claude Code, Codex
information-security-manager-iso27001seaworld008/Commonly-used-high-value-skillsSkill752d agoMITA34Claude Code, Codex
bmad-specalvin-reyes/better-agentic-ideSkill3813d agoMITA76Claude Code
video-editoroyi77/1ai-skillsSkill19yesterdayMITA59Claude Code
bmad-advanced-elicitationalvin-reyes/better-agentic-ideSkill3813d agoMITA55Claude Code
ai-newsletteroyi77/1ai-skillsSkill19yesterdayMITA36Claude Code
responsive-designoyi77/1ai-skillsSkill19yesterdayMITA23Claude Code