v0.1.20 · macOS 26 · MIT

Background,
gone.

The UNIX-style background remover for macOS. Apple Vision on-device. No cloud, no API keys, no GUI side-effects.

$ brew install Arthur-Ficial/tap/bgbgone

Apple Silicon · macOS 26+ · source on GitHub

inout
Show, don't tell

One flag. Sixteen subjects.

Same CLI invocation against sixteen strict-public-domain Wikimedia subjects: photography, painting, spacecraft, woodblock print, vintage product ad. Zero per-image tuning.

Grid of 16 source → cutout pairs: NASA spaceflight imagery, paintings (Mona Lisa, Vermeer, Hokusai), 19th-century studio portraits (Einstein, Tesla, Wright Brothers, Edison) and vintage product ads (Singer, Underwood, Pierce-Arrow).

$ bgbgone in.jpg > out.png  ·  16 strict-PD subjects · zero config

Matte controls

Feather, threshold, padding, shadow.

Every knob, on the same studio portrait — feather 0 → 16 px, then crop, padding, shadow and the raw alpha matte (--mask-only). The compositor blends with that matte to produce every other output on this page.

Top row: --feather 0, 1, 4, 8, 16 progressively softening Einstein's portrait. Bottom row: --crop, --padding, --shadow, --mask-only.

--feather · --crop · --padding · --shadow · --mask-only

--algo

Three algorithms, side by side.

Apple Vision exposes three public segmentation primitives. auto = foreground-instance mask; person = portrait segmenter; saliency = objectness heat map. Unsupported names are rejected at parse with exit code 2 — never silently routed.

--algo vn-mask, person, saliency on three PD subjects: Mars Curiosity rover, Wright Brothers, Mona Lisa.

--algo vn-mask · person · saliency

How it works

Apple Vision in a UNIX pipe.

Every Mac since macOS 14 ships VNGenerateForegroundInstanceMaskRequest — only callable from Swift. bgbgone is the thin, hard-tested CLI that wraps it.

~/photos
# single cutout to a transparent PNG
$ bgbgone photo.jpg > out.png

# brand background, JPEG, tight crop, soft edge
$ bgbgone selfie.jpg --bg color:#0066cc --crop --feather 2 \
    --to jpg --quality 95 -o avatar.jpg

# batch a folder, stream NDJSON for jq
$ ls *.heic | xargs -I{} bgbgone {} --ndjson --out-dir ./out/ \
    | jq -s 'group_by(.algo) | map({algo: .[0].algo, n: length})'

# pipe into auge for cleaner downstream classification
$ bgbgone in.jpg --bg color:black --to jpg -o /tmp/c.jpg \
    && auge --classify /tmp/c.jpg --top 3
0
network calls

NetworkGuard registers a URLProtocol that intercepts http / https / ws / wss inside the process and exits with code 3 if anything tries.

75
tests passing

60 unit tests on the pure-Swift core (no XCTest, no Testing framework). 15 integration tests spawning the real binary across all 16 PD fixtures.

86 ms
avg per image

100-image performance harness: 11.6 images/s, 86 ms/image on Apple Silicon. One make perf-100 guards the regression.

Install

One brew tap. Two minutes.

Apple Silicon, macOS 26+. No Xcode required.

Homebrew

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

bgbgone --version
bgbgone --check
bgbgone photo.jpg > cutout.png

Already installed? brew upgrade bgbgone.

From source

git clone https://github.com/Arthur-Ficial/bgbgone
cd bgbgone
make install

# bumps patch, builds release,
# installs to /usr/local/bin

Regenerate README assets with make readme-images; ship with make release.

Sibling tools

Part of the apfel ecosystem.

On-device CLI tools for Apple frameworks Apple never wrapped. Each one is one binary, one purpose.

ToolCapabilityApple framework
apfelLLM (text generation)FoundationModels
augeVision / OCRVision
bgbgone (this)Background removalVision + Core Image
ohrSpeech-to-textSpeechAnalyzer
kernEmbeddingsNLContextualEmbedding