Background removal CLI for local image processing

Use the bgcut CLI for shell scripts, build jobs, local automation, and file-in/file-out workflows.

Run it without a global install

A one-off command can process an image with the published bgcut package. PNG is the default output.

npx bgcut photo.jpg
npx bgcut photo.jpg -o portrait.png

Choose output and engine constraints

WebP output is lossless and can preserve transparency. JPEG is flattened onto white because JPEG has no alpha channel.

Automatic native mode tries WebGPU and can use CPU if runtime creation cannot use WebGPU. Explicit GPU and CPU flags keep that choice strict.

npx bgcut photo.jpg --webp
npx bgcut photo.jpg --gpu
npx bgcut photo.jpg --cpu

Keep the image local

The CLI runs the model on the machine where the command executes. It does not upload the source image to a bgcut inference backend.