Skip to main content

BG Remover Assets

Prepare transparent image cutouts for product catalogs, marketplaces and design workflows: trim transparent margins, center the subject on a square canvas and optionally add a background color. All processing is local using Pillow.

This is a cutout post-processing utility, not an AI background removal engine. Opaque JPEG images retain their backgrounds. Start with a transparent cutout to trim its transparent margins.

Install

Python 3.10 or newer:

pip install bg-remover-assets

Examples

bg-remover-assets ./cutouts ./catalog --size 1024 --padding 64 --recursive
bg-remover-assets ./cutout.png ./white-catalog --background white
bg-remover-assets ./cutout.png ./custom-catalog --background '#eeeeee'

The subject is cropped to its nonzero alpha bounds, fitted without upscaling and centered with at least the requested padding. Fully transparent inputs produce an empty canvas. Output is RGBA PNG, with transparent background unless a color is supplied. EXIF orientation is respected. For animated files only the first frame is used.

The output directory must be outside the input directory. Existing outputs are skipped. Folder structure is preserved with --recursive. Original extensions are retained in output names (item.jpg.png) to avoid collisions. Corrupt files are reported individually and processing continues; exit code 1 means at least one failure. Symlink files are skipped.

Python API

from PIL import Image
from bg_remover_assets.cli import prepare

with Image.open('cutout.png') as image:
    prepare(image, size=1024, padding=64, background='white').save('catalog.png')

BG Remover is the related browser-based product for background removal. This package is a standalone local companion utility: it neither calls the website nor requires an account or API key. No images or telemetry are uploaded by this package.

License

MIT. Pillow retains its own license.

Metadata

Release files for bg-remover-assets 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bg-remover-assets 0.1.0
File Size Uploaded Provenance Actions
bg_remover_assets-0.1.0.tar.gz 4.4 kB Without provenance Details for bg_remover_assets-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bg-remover-assets 0.1.0
File Interpreter ABI Platform Actions
bg_remover_assets-0.1.0-py3-none-any.whl Python 3 none any Details for bg_remover_assets-0.1.0-py3-none-any.whl

Total release size: 9.5 kB

Release files / bg_remover_assets-0.1.0.tar.gz

Download URL bg_remover_assets-0.1.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2fd4a6073593819cbda3cce588e039b50ee0b412b9a5e46c30beef57ad31c5ed
BLAKE2b-256 checksum
How to use checksums
3cf731b89e1afd5c451e25930810fc56891dd4d0d1201e85908e72da05910388
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / bg_remover_assets-0.1.0-py3-none-any.whl

Download URL bg_remover_assets-0.1.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f17637e1803c56a5b42d2ef5b9c540b0fbe0d451df3c41bdb78adc8851c19dbe
BLAKE2b-256 checksum
How to use checksums
c5e8fea5817a11051dc13057fe0af66fb058ce19d3af81e692648814cc192078
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for bg-remover-assets 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page