API & Integrations
How to use the remove.bg CLI tool
How to use the remove.bg CLI tool

How to use the remove.bg CLI tool

Below you can find an explanation for downloading the Command Line tool and executing your first command.

If you're interested in a more in-depth step-by-step guide about how to process a folder of images, save to a different directory, add a background color, and more, you can dive into our blog post.

Let's get started:

The first step is to download the latest stable release for your platform of choice.

Extract the archive file to your destination folder of choice. If you would like to be able to use the CLI tool from anywhere on your computer, make sure to add the path to your > PATH environment variable.

Execute your first command

Windows

Open the Command Prompt by clicking on the Start Menu, typing cmd, and hitting ENTER.

Mac

Open the terminal by clicking the Launchpad icon, then searching for > terminal.

Linux

Open the terminal in accordance with your Linux distribution.

To execute a command using the CLI tool, you must follow the basic structure:

removebg [options] file...

If you didn’t update your PATH environment variable,  you need to give the full path of the executable:

Windows:

C:\removebg\removebg [options] file...

Mac/Linux:

/path/to/removebg/removebg [options] file...

For the [options] part, each option follows the same structure:

--option value

So, for example, if you didn't add REMOVE_BG_API_KEY to your environment variables, you must always enter the API key as an option:

removebg --api-key your_api_key_here

The file part of the command is where you tell the CLI tool which files you'd like to process.

For a more detailed explanation, read how to remove and replace the background of multiple images using remove.bg's CLI tool.

Was this article helpful? Yes No
Thanks for your feedback.
remove.bg - Remove Background from Image 100% Free! | Product Hunt
  • 了解更多

  • 魔力笔刷
  • 私人
  • 摄影师
  • 营销
  • 开发人员
  • 电子商务
  • 媒体
  • 汽车经销商
  • 企业
  • Success stories
  • 工具和 API

  • API 文档
  • 集成、工具和应用
  • Photoshop 扩展
  • Windows / Mac / Linux
  • Android 应用
  • 设计模板
  • 支持

  • 帮助和常见问题
  • 联系我们
  • 退款
  • 平台状态
  • 公司

  • 博客
  • 伙伴计划
  • 创建自动化设计
  • 视频背景消除
  • 就业机会
  • 关于我们
  • 按下

© remove.bg, a Canva Austria GmbH brand

  • 服务条款
  • 一般条款和交易条件
  • 隐私政策
  • Cookie政策
  • 印记

感谢您的反馈!

希望帮助我们改进? (可选)

  • 捐助这张图片并帮助我们把 remove.bg 变得更好
  • 训练人工智能
  • 在未来对类似图片取得更好的效果
如果您希望我们将此图用于质量改进的话,请勾选
如果您不希望我们将此图用于质量改进的话,请勾选此项。

您的图片将被用于 remove.bg 的未来改进。

您的图片将不会被用于 remove.bg 的未来改进。