{"id":13708110,"url":"https://github.com/remove-bg/remove-bg-cli","last_synced_at":"2026-01-18T11:46:48.156Z","repository":{"id":37383175,"uuid":"413362810","full_name":"remove-bg/remove-bg-cli","owner":"remove-bg","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-08T11:37:08.000Z","size":8450,"stargazers_count":212,"open_issues_count":0,"forks_count":34,"subscribers_count":11,"default_branch":"main","last_synced_at":"2024-11-13T17:45:39.400Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remove-bg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-04T09:49:02.000Z","updated_at":"2024-11-11T09:22:48.000Z","dependencies_parsed_at":"2024-07-12T01:42:27.256Z","dependency_job_id":"0f9149a5-c707-4fee-84d5-f9e87ec80e13","html_url":"https://github.com/remove-bg/remove-bg-cli","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remove-bg%2Fremove-bg-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remove-bg%2Fremove-bg-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remove-bg%2Fremove-bg-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remove-bg%2Fremove-bg-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remove-bg","download_url":"https://codeload.github.com/remove-bg/remove-bg-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252640053,"owners_count":21780864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T22:01:56.315Z","updated_at":"2025-05-06T07:31:42.114Z","avatar_url":"https://github.com/remove-bg.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"## Installation\n\n### Download\n\nYou can **[download latest stable release][releases]** (Windows, Mac, and Linux supported)\n\n### Homebrew\n\n```\nbrew install remove-bg/homebrew-tap/removebg\n```\n\n### Installation\n\nDownload the .zip or .tar.gz from the [releases page][releases] and unzip with your favorite decompression tool. Then move the binary to a folder in your path.\n\n[releases]: https://github.com/remove-bg/remove-bg-cli/releases/\n\n## Usage\n\n```\nremovebg [options] \u003cfile\u003e...\n```\n\n### API key\n\nTo process images you'll need your [remove.bg API key][api-key].\n\n[api-key]: https://www.remove.bg/profile#api-key\n\nTo use the API key for all requests you can export the following environment\nvariable in your shell profile (e.g. `~/.bashrc` / `~/.zshrc`):\n\n```sh\nexport REMOVE_BG_API_KEY=xyz\n```\n\nAlternatively you can specify the API key per command:\n\n```sh\nremovebg --api-key xyz images/image1.jpg\n```\n\n### Processing a directory of images\n\n#### Saving to the same directory (default)\n\nIf you want to remove the background from all the PNG and JPG images in a\ndirectory, and save the transparent images in the same directory:\n\n```sh\nremovebg images/*.{png,jpg}\n```\n\nGiven the following input:\n\n```\nimages/\n├── dog.jpg\n└── cat.png\n```\n\nThe result would be:\n\n```\nimages/\n├── dog.jpg\n├── cat.png\n├── dog-removebg.png\n└── cat-removebg.png\n```\n\n#### Saving to a different directory (`--output-directory`)\n\nIf you want to remove the background from all the PNG and JPG images in a\ndirectory, and save the transparent images in a different directory:\n\n```sh\nmkdir processed\nremovebg --output-directory processed originals/*.{png,jpg}\n```\n\nGiven the following input:\n\n```\noriginals/\n├── dog.jpg\n└── cat.png\n```\n\nThe result would be:\n\n```\noriginals/\n├── dog.jpg\n└── cat.png\n\nprocessed/\n├── dog.png\n└── cat.png\n```\n\n### CLI options\n\n- `--api-key` or `REMOVE_BG_API_KEY` environment variable (required).\n\n- `--output-directory` (optional) - The output directory for processed images.\n\n- `--reprocess-existing` - Images which have already been processed are skipped\nby default to save credits. Specify this flag to force reprocessing.\n\n- `--confirm-batch-over` (default `50`) - Prompt for confirmation before\nprocessing batches over this size. Specify `-1` to disable this safeguard.\n\n- `--skip-png-format-optimization` - By default the cli calls the API with `zip` format for maximum output resolution. \nWhen specifying this flag it will use `png` format to save bandwidth by limiting the output resolution to 10 megapixels.\n\n\n#### Image processing options\n\nPlease see the [API documentation][api-docs] for further details.\n\n[api-docs]: https://www.remove.bg/api#operations-tag-Background%20Removal\n\n- `--size` (default `auto`)\n- `--type`\n- `--channels`\n- `--bg-color`\n- `--bg-image-file`\n- `--format` (default: `png`)\n- `--extra-api-option` for forwarding any unlisted/new option to the API\n  - Formatted as key/value pair (`=` between key/value)\n  - it is possible to use this option multiple times e.g. `--extra-api-option crop=true --extra-api-option add_shadow=true`\n\n## Examples\n\n```sh\n# Producing a JPG with a grey background at the path: processed/subject.jpg\nremovebg subject.jpg --format jpg --bg-color 7a7a7a --output-directory processed\n\n# Producing a large transparent PNG image up to 25 megapixels\nremovebg large.jpg --size full --format png\n\n# Processing a car image with additional API options\nremovebg car.jpg --type car --extra-api-option add_shadow=true --extra-api-option semitransparency=true\n```\n\n# zip2png\n\nThe zip2png command is now included in the remove.bg command line interface. Pass the result zip file from remove.bg as parameter and the command converts it into a transparent png file.\n\n```\nremovebg zip2png --file /path/to/file.zip \n```\n\n## Development\n\nPrerequisites:\n\n- `nodejs 14.18.1`\n\nGetting started:\n\n```\ngit clone git@github.com:remove-bg/remove-bg-cli.git\ncd remove-bg-cli\nnpm i\nnpm run build\nnpm run test\n```\n\nTo build \u0026 try out locally:\n\n```\nnpm run build\n./dist/removebg --help\n```\n\n### Creating a binary executable\n\n- npm i -g pkg\n- npm run build\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremove-bg%2Fremove-bg-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremove-bg%2Fremove-bg-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremove-bg%2Fremove-bg-cli/lists"}