← Back to Skills Marketplace
sxliuyu

Bg Remove

by SxLiuYu · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
200
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install background-remove-pro
Description
智能识别并移除图片背景,支持多格式批量处理,输出带透明通道的PNG,可选本地或云端模型。
README (SKILL.md)

bg-remove

图片智能去背景工具,使用 RMBG-1.4 或 rembg 库实现高精度背景移除。

功能

  • 智能去背景: 使用 AI 模型自动识别并移除图片背景
  • 支持多种格式: PNG、JPG、WebP、BMP 等常见图片格式
  • 批量处理: 支持批量处理多张图片
  • 透明背景: 输出带透明通道的 PNG 图片
  • 支持本地模型: 可选择使用本地模型或默认模型

触发词

  • 去背景、移除背景、图片去背景
  • 抠图、去除图片背景、透明背景
  • bg-remove、remove background

使用方法

基本用法

# 去除单张图片背景
/bg-remove --input photo.jpg

# 指定输出路径
/bg-remove --input photo.jpg --output result.png

# 批量处理整个文件夹
/bg-remove --input ./photos --output ./output

# 使用特定模型
/bg-remove --input photo.jpg --model RMBG-1.4

高级选项

# 调整处理阈值 (0-1)
/bg-remove --input photo.jpg --threshold 0.5

# 保持原始文件名
/bg-remove --input ./photos --output ./output --keep-name

# 覆盖已存在的文件
/bg-remove --input photo.jpg --force

命令参数

参数 简写 说明 默认值
--input -i 输入图片或文件夹路径 必填
--output -o 输出路径(文件或文件夹) 同输入目录
--model -m 使用的模型 (u2net/RMBG-1.4) u2net
--threshold -t 分割阈值 (0-1) 0.5
--keep-name -k 保持原始文件名 false
--force -f 覆盖已存在的文件 false
--alpha-matting - 启用 Alpha Matting 增强边缘 false
--alpha-matting-foreground - Alpha Matting 前景阈值 240
--alpha-matting-background - Alpha Matting 背景阈值 10

输出说明

  • 输出格式为 PNG,支持透明通道
  • 文件名默认添加 _nobg 后缀
  • 处理后的图片可直接用于设计、电商、产品展示等场景

示例

# 电商产品图去背景
/bg-remove --input ./product.jpg --output ./product_nobg.png

# 批量处理证件照背景
/bg-remove --input ./photos/ --output ./results/

# 人像照片去背景
/bg-remove --input portrait.jpg --model RMBG-1.4 --alpha-matting

依赖

  • Python 3.8+
  • rembg
  • pillow
  • onnxruntime

首次使用会自动下载模型文件。

Usage Guidance
This skill's code matches its purpose: local image background removal using rembg and Pillow. Before installing or running it, consider: (1) rembg (or its dependencies) may automatically download model weights from the internet on first run — if you need to control network access or trust the model source, run in a sandbox or pre-download vetted model files; (2) SKILL.md mentions onnxruntime and 'cloud models' but the package metadata and script don't implement cloud endpoints or declare onnxruntime as a dependency — if you rely on those features, ask the author for clarification or verify behavior; (3) install dependencies in a virtualenv and inspect where models are downloaded from (rembg documentation) to confirm you are comfortable with the remote hosts. If you are unsure about automatic downloads or running third-party Python packages, test the skill on non-sensitive images in an isolated environment first.
Capability Analysis
Type: OpenClaw Skill Name: background-remove-pro Version: 1.0.0 The skill bundle is a legitimate tool for removing image backgrounds using the 'rembg' library. The Python script (scripts/bg-remove.py) uses standard libraries (PIL, pathlib, argparse) to process single images or directories, and the SKILL.md provides clear, safe instructions for the AI agent without any signs of prompt injection, data exfiltration, or malicious execution.
Capability Assessment
Purpose & Capability
Name/description, script, and metadata consistently describe a local image background-removal tool using rembg/Pillow. However, SKILL.md and descriptions mention support for 'cloud models' and list onnxruntime as a dependency while _meta.json and the script only declare rembg and pillow. The script exposes model choices including 'RMBG-1.4' but contains no explicit logic for selecting a remote/cloud endpoint. This is a minor mismatch between claimed capabilities (cloud option, onnxruntime) and what the package actually implements.
Instruction Scope
SKILL.md and the Python script are focused on reading image files and writing PNG outputs. The runtime instructions and code only reference input/output paths and do not read environment variables, unrelated local files, or system secrets. No instructions direct data to external endpoints. The SKILL.md is fairly specific and does not grant broad discretionary access.
Install Mechanism
There is no install spec (instruction-only with an included script), so nothing is automatically written by a platform installer. SKILL.md and the script indicate that required Python packages must be installed and that '首次使用会自动下载模型文件' (first use will auto-download model files). That implies network activity to fetch model weights at runtime (handled by rembg or related libs), which is expected for model-based tools but is an implicit operation you should be aware of. No install URLs or arbitrary archives are included.
Credentials
The skill requests no environment variables, no credentials, and only file read/write permissions which are required for image processing. The number and type of permissions are proportionate to the stated purpose.
Persistence & Privilege
The skill is not always-enabled and does not request elevated platform persistence. It does not attempt to modify other skills or system-wide configuration. Autonomous invocation is allowed (platform default) but not combined here with other concerning privileges.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install background-remove-pro
  3. After installation, invoke the skill by name or use /background-remove-pro
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of bg-remove, providing intelligent AI-based background removal for images. - Supports multiple input formats (PNG, JPG, WebP, BMP) and outputs transparent PNG files. - Enables batch processing for folders and can keep original file names. - Option to select between different models (u2net or RMBG-1.4) and use local models. - Includes advanced options: adjustable threshold, alpha matting for improved edges, and file overwrite control. - Command-line usage with detailed parameter documentation and clear example commands.
Metadata
Slug background-remove-pro
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Bg Remove?

智能识别并移除图片背景,支持多格式批量处理,输出带透明通道的PNG,可选本地或云端模型。 It is an AI Agent Skill for Claude Code / OpenClaw, with 200 downloads so far.

How do I install Bg Remove?

Run "/install background-remove-pro" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Bg Remove free?

Yes, Bg Remove is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Bg Remove support?

Bg Remove is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Bg Remove?

It is built and maintained by SxLiuYu (@sxliuyu); the current version is v1.0.0.

💬 Comments