All Projects → remove-bg → go

remove-bg / go

Licence: MIT License
Go-based command-line tool for the remove.bg API

Programming Languages

go
31211 projects - #10 most used programming language
ruby
36898 projects - #4 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to go

utility
Collection of command line utilities
Stars: ✭ 36 (-60.44%)
Mutual labels:  command-line-tool
shy
💀 bare-bones ssh launcher
Stars: ✭ 51 (-43.96%)
Mutual labels:  command-line-tool
Zeiver
A Scraper, Downloader, & Recorder for static open directories.
Stars: ✭ 14 (-84.62%)
Mutual labels:  command-line-tool
Node-CLI-Tips-Tricks
📟 NodeCLI.com repo with Node.js CLI best practices and production-ready tips & tricks.
Stars: ✭ 132 (+45.05%)
Mutual labels:  command-line-tool
starcli
✨ Browse trending GitHub projects from your command line
Stars: ✭ 436 (+379.12%)
Mutual labels:  command-line-tool
electron-open-url
Open URL with Electron window from command line or Node.js program
Stars: ✭ 16 (-82.42%)
Mutual labels:  command-line-tool
dockerize
Utility to simplify running applications in docker containers
Stars: ✭ 91 (+0%)
Mutual labels:  command-line-tool
Pomodoro-Calculator
A pretty command line tool to calculate the number of pomodoros available between two points in time.
Stars: ✭ 20 (-78.02%)
Mutual labels:  command-line-tool
imgur-scraper
Retrieve years of imgur.com's data without any authentication.
Stars: ✭ 26 (-71.43%)
Mutual labels:  command-line-tool
logya
Logya is a static site generator written in Python designed to be easy to use and flexible.
Stars: ✭ 16 (-82.42%)
Mutual labels:  command-line-tool
whats
🌐 a terminal translation tool
Stars: ✭ 16 (-82.42%)
Mutual labels:  command-line-tool
doi2bib
📝 Easily convert Digital Object Identifier (DOI) and Uniform Resource Locator (URL) to BibTeX and DOI to plain text.
Stars: ✭ 28 (-69.23%)
Mutual labels:  command-line-tool
hoard
cli command organizer written in rust
Stars: ✭ 71 (-21.98%)
Mutual labels:  command-line-tool
moshpit
A powerful cross-platform command-line tool for datamoshing.
Stars: ✭ 74 (-18.68%)
Mutual labels:  command-line-tool
editorconfig-cli
📝🔧 initialize .editorconfig in your terminal
Stars: ✭ 26 (-71.43%)
Mutual labels:  command-line-tool
xcode-cli
Command line helpers for Xcode
Stars: ✭ 17 (-81.32%)
Mutual labels:  command-line-tool
gq-gmc-control
Control tool for the GQ GMC Geiger Counters.
Stars: ✭ 34 (-62.64%)
Mutual labels:  command-line-tool
yj
Command line tool that converts YAML to JSON
Stars: ✭ 62 (-31.87%)
Mutual labels:  command-line-tool
goto
Goto - The Good Way to Program
Stars: ✭ 14 (-84.62%)
Mutual labels:  command-line-tool
gogs-bash
Bash Script for Interacting with the GOGS API
Stars: ✭ 31 (-65.93%)
Mutual labels:  command-line-tool

remove.bg CLI

CircleCI

Installation

Download

You can download latest stable release (Windows, Mac, and Linux supported)

Homebrew

brew install remove-bg/homebrew-tap/removebg

deb / rpm

Download the .deb or .rpm from the releases page and install with dpkg -i and rpm -i.

For the latest deb package supporting x86-64 you can also run:

curl -LO $(curl https://api.github.com/repos/remove-bg/go/releases/latest | grep -o "https://github.com/remove-bg/go/releases/download/.*linux_amd64.deb")
sudo dpkg -i removebg*.deb

Usage

removebg [options] <file>...

API key

To process images you'll need your remove.bg API key.

To use the API key for all requests you can export the following environment variable in your shell profile (e.g. ~/.bashrc / ~/.zshrc):

export REMOVE_BG_API_KEY=xyz

Alternatively you can specify the API key per command:

removebg --api-key xyz images/image1.jpg

Processing a directory of images

Saving to the same directory (default)

If you want to remove the background from all the PNG and JPG images in a directory, and save the transparent images in the same directory:

removebg images/*.{png,jpg}

Given the following input:

images/
├── dog.jpg
└── cat.png

The result would be:

images/
├── dog.jpg
├── cat.png
├── dog-removebg.png
└── cat-removebg.png

Saving to a different directory (--output-directory)

If you want to remove the background from all the PNG and JPG images in a directory, and save the transparent images in a different directory:

mkdir processed
removebg --output-directory processed originals/*.{png,jpg}

Given the following input:

originals/
├── dog.jpg
└── cat.png

The result would be:

originals/
├── dog.jpg
└── cat.png

processed/
├── dog.png
└── cat.png

CLI options

  • --api-key or REMOVE_BG_API_KEY environment variable (required).

  • --output-directory (optional) - The output directory for processed images.

  • --reprocess-existing - Images which have already been processed are skipped by default to save credits. Specify this flag to force reprocessing.

  • --confirm-batch-over (default 50) - Prompt for confirmation before processing batches over this size. Specify -1 to disable this safeguard.

Image processing options

Please see the API documentation for further details.

  • --size (default auto)
  • --type
  • --channels
  • --bg-color
  • --format (default: png)
  • --extra-api-options for forwarding any unlisted/new options to the API
    • Formatted as a URI encoded string (= between key/value, delimited with &)
    • e.g. --extra-api-options 'crop=true&add_shadow=true'

Examples

# Producing a JPG with a grey background at the path: processed/subject.jpg
removebg subject.jpg --format jpg --bg-color 7a7a7a --output-directory processed

# Producing a large transparent PNG image up to 25 megapixels
removebg large.jpg --size full --format png

# Processing a car image with additional API options
removebg car.jpg --type car --extra-api-options 'add_shadow=true&semitransparency=true'

Development

Prerequisites:

Getting started:

git clone [email protected]:remove-bg/go.git $GOPATH/github.com/remove-bg/go
cd $GOPATH/github.com/remove-bg/go
bin/setup
bin/test

To build & try out locally:

go build -o removebg main.go
./removebg --help

Releasing a new version

GITHUB_TOKEN=xyz bin/release vX.Y.Z
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].