OpenViSTAI · Agents · Blockchain · Crypto
Menu
Image & Video AI

withoutBG

withoutBG is a Python SDK for removing image backgrounds in scripts, notebooks, backends and batch jobs. It offers local open-weight inference and a Cloud API through the same interface, returning processed images as PIL RGBA objects.

Independent OpenViST project profile, based on linked sources.

withoutBG — OpenViST project profile in Image & Video AI.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use the SDK when background removal needs to sit inside Python code or a CLI workflow. Choose local mode for offline or private processing and batches; choose the Cloud API when avoiding local model setup or seeking the README's stated improvement on hair and fur edges.

Who it is for

  • Python developers adding background removal to image-processing pipelines.
  • Teams preparing product images or processing batches locally.
  • Developers who prefer an API-backed integration for occasional use or product workflows.

Documented uses

  • Remove a background from an image and save a transparent PNG or WebP.
  • Process multiple images in a Python batch workflow while keeping a local model loaded.
  • Choose between local CPU-based ONNX processing and a cloud API for image cutouts.
  • Use a command-line interface to process a single image.
Before you choose

Requirements & limits

The README describes local open-weight processing as free and the Cloud API as pay per image. Local setup downloads about 1.5 GB of weights on first use; Cloud mode requires an API key.

  • Local mode uses CPU ONNX and does not require a GPU; the first run downloads about 1.5 GB of weights.
  • Cloud mode requires an API key and sends images to the API; the README describes it as better for hair and fur edges.
  • The SDK returns PIL images in RGBA mode; PNG and WebP preserve transparency, while JPEG drops it.
  • For batch processing, the README advises loading the model once rather than recreating it for each image.
  • The repository README displays an Apache 2.0 license badge.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Remove one image background locally in Python

Install the package, process an input image with local open weights, and save a transparent PNG.

Before you start

  • Python package manager uv.
  • The withoutbg Python package.
  • About 1.5 GB for the first local model-weight download from Hugging Face.

Steps

  1. Install the package with the command below.

    Documented command
    uv add withoutbg
  2. Create a model with WithoutBG.open_weights().

  3. Pass an image path to model.remove_background() and save the returned image as PNG.

Expected outcome

A PIL image in RGBA mode is saved as a PNG with transparency.

Guide limitations

  • The first local run downloads about 1.5 GB of weights; the BiRefNet branch is fetched the first time an image needs it.
  • JPEG drops transparency silently; use PNG or WebP to preserve it.
  • The README states that local processing can run on CPU without a GPU.
Source-based practical guide

Remove an image background with the Cloud API

Configure the SDK with an API key and save the processed image as PNG.

Before you start

  • The withoutbg Python package.
  • A withoutBG Cloud API key, passed as api_key or set as WITHOUTBG_API_KEY.

Steps

  1. Create a model with WithoutBG.api(api_key="..."), or configure WITHOUTBG_API_KEY.

  2. Pass the input image path to model.remove_background().

  3. Save the returned image as PNG to retain transparency.

Expected outcome

A processed PIL image in RGBA mode is saved as a transparent PNG.

Guide limitations

  • Cloud mode sends the image to the API.
  • The README describes Cloud API use as pay per image.
  • JPEG drops transparency silently.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
17 October 2026
Original website title
withoutbg/withoutbg-python · Official homepage title · retained in its source language

Related options

withoutBG Docker/self-host — A separate project surface described in the README for running an HTTP API or browser UI on a server; the Python SDK is the in-process option.