Skip to main content

removebg-cli

智能图片背景移除命令行工具,基于 remove.bg API。

安装

pipx install removebg-cli

或使用 pip:

pip install removebg-cli

配置

设置环境变量(必须):

export REMOVE_BG_API_KEY='你的API密钥'
# 添加到 ~/.zshrc 或 ~/.bashrc 以持久化

获取 API Key: https://www.remove.bg/dashboard#api-key

使用

# 处理本地图片
removebg photo.jpg

# 处理网络图片 (自动识别URL)
removebg https://example.com/image.jpg

# 指定输出文件
removebg photo.jpg -o result.png

# 高清输出
removebg photo.jpg -s full

# 白色背景
removebg photo.jpg -b white

# 裁剪空白区域
removebg photo.jpg -c

# 查看账户余额
removebg --account

参数说明

参数 说明
-o, --output 输出文件路径
-s, --size 尺寸: auto/preview/full/50MP
-f, --format 格式: auto/png/jpg/webp/zip
-b, --bg 背景色: white/ff0000
-c, --crop 裁剪空白区域
--shadow 添加阴影
--account 查看余额

特性

  • 自动识别本地文件/URL
  • 默认透明PNG输出
  • 低额度警告 (≤10次)
  • 请求限流自动重试
  • 美化日志输出

License

MIT

Metadata

Release files for removebg-cli 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for removebg-cli 1.0.0
File Size Uploaded Provenance Actions
removebg_cli-1.0.0.tar.gz 5.1 kB Without provenance Details for removebg_cli-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for removebg-cli 1.0.0
File Interpreter ABI Platform Actions
removebg_cli-1.0.0-py3-none-any.whl Python 3 none any Details for removebg_cli-1.0.0-py3-none-any.whl

Total release size: 10.7 kB

Release files / removebg_cli-1.0.0.tar.gz

Download URL removebg_cli-1.0.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
aafd9995946b402f9b928708775f7928c7967f6caf02e38b6425f4c4c6dd138f
BLAKE2b-256 checksum
How to use checksums
5ee440d1b2c91f5313012d3052b27900470b5d89f33e551e571ce0da774c6517
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.6

Release files / removebg_cli-1.0.0-py3-none-any.whl

Download URL removebg_cli-1.0.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35d961d59bab5a16bc94058e58dd6cc157fa6fe331cb0f74de847222cd000654
BLAKE2b-256 checksum
How to use checksums
93329c0019b6c4a55462f558fdad2f52f489c0514bd8966665cce725831d9f31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.6

Security for removebg-cli 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page