Metadata-Version: 2.4
Name: bg-remover-assets
Version: 0.1.0
Summary: Trim transparent margins and standardize cutout images for product catalogs
License-Expression: MIT
Project-URL: Homepage, https://bg-remover.app/
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Pillow<14,>=10.4
Dynamic: license-file

# 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:

```sh
pip install bg-remover-assets
```

## Examples

```sh
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

```python
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')
```

## Related website

[BG Remover](https://bg-remover.app/) 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.
