bgbgone — Background, be gone.

3 min read Original article ↗

v1.2.23 macOS 26+ Swift 6.3+ MIT 100% on-device

Background remover for macOS. Image in, image out — Apple Vision, on-device, scriptable.

$brew install Arthur-Ficial/tap/bgbgone

3 MB binary. No cloud. No account.

Bruce McCandless on his 1984 untethered spacewalk — original NASA photo with the black of space behind him The same astronaut with the space background removed by bgbgone, isolated on transparency
source · NASA STS-41-B · 1984 bgbgone in.jpg → cutout.png ↔ drag

Mac app v0.3.4 Apple silicon

Rather have a window than a flag? Get the app.

The same on-device engine, in a native macOS window. Drop a folder, watch it process — end up with a folder of clean cutouts. Never touch a terminal.

The bgbgone Mac app: a Finder-style window showing three demo photographs processed into transparent cutouts, with an original-versus-cutout preview pane and an algorithm inspector on the right

02 · Receipts

Numbers, not adjectives.

Measured bgbgone performance and cost figures
81ms

per image

12.3/s

throughput

3MB

binary

0net

network calls

0$

forever

03 · Install

Install. Run.

Install

brew tap Arthur-Ficial/tap
brew install Arthur-Ficial/tap/bgbgone

From source: make install. macOS 26+, no Xcode.

Use

# default: writes photo_bgbgone.png next to input
$ bgbgone photo.jpg

# transparent PNG to stdout
$ bgbgone photo.jpg > cutout.png

# on a solid colour
$ bgbgone photo.jpg --bg color:white -o on-white.png

# on an image
$ bgbgone photo.jpg --bg image:beach.jpg -o beach.png

# pipe in
$ cat in.png | bgbgone > out.png

# batch a folder
$ bgbgone *.jpg --out-dir ./out/

# local HTTP API on 127.0.0.1:8787
$ bgbgone --server

05 · Flags

The whole surface.

Background

  • --bg color:<#hex|named|rgb:r,g,b>solid colour
  • --bg image:<path>image file
  • --bg-color <spec>shared solid colour field
  • --bg-image <path>shared background image field
  • --bg-fit cover|contain|tile|centerfit mode for image backgrounds

Matte / edge

  • --mask-onlyoutput the alpha mask only
  • --channels rgba|alphafinalized image or alpha mask
  • --feather <px>edge softening (default: 1)
  • --threshold <0..1>mask binarisation
  • --padding <px|N%>extra space around subject
  • --crop-margin <1|2|4 values>API-style crop margins
  • --croptight-crop to subject bbox
  • --roi "x1 y1 x2 y2"region of interest, px or %
  • --scale <10%..100%|original>scale subject on canvas
  • --position <center|x% y%|original>place scaled subject
  • --semitransparency true|falsekeep or harden semi-transparent pixels
  • --shadowdrop shadow under cutout
  • --shadow-type auto|drop|3D|car|noneshadow selector
  • --shadow-opacity <0..100|auto>shadow darkness

Algorithm

  • --algo auto|vn-mask|person|saliencydefault: auto
  • --type auto|person|product|car|animal|graphic|transportationtype hint

Multi-instance

  • --multione file per detected instance
  • --instance-naming "{base}-{n}.{ext}"filename template ({n:NN})

Output

  • --to, --format png|jpg|zip|heic|avif|tiffoutput format (default: png)
  • --size preview|full|50MP|autooutput megapixel cap
  • --quality 1..100for lossy formats (default: 92)
  • -o, --output <path>explicit output file
  • --out-dir <dir>batch output directory

Server

  • --serverrun local HTTP API
  • --host <addr>bind address (default: 127.0.0.1)
  • --port <n>bind port (default: 8787)
  • --corsenable CORS for allowed origins
  • --allowed-origins <csv>add allowed browser origins
  • --no-origin-check | --footgundisable browser origin checks
  • --token <secret> | --token-autorequire Bearer token
  • --public-healthkeep /health public on non-loopback binds
  • --max-body-mb <n>request body limit (default: 32)

Meta & exit codes

  • --json | --ndjsonstructured output
  • --quiet | --verboselogging level
  • --version | --help | -hmeta
  • --checkcapability report
Exit codes
0success
1user error (bad input, refusing TTY)
2parser error or no result
3framework error (Vision unavailable)

06 · Privacy

Run it with Wi-Fi off.

04

Images stay yours.

07 · Ecosystem

Part of the apfel family.

Install

Background, be gone.

$brew install Arthur-Ficial/tap/bgbgone