Make images with transparent background
Project description
Transparent Background
This is a background removing tool based on InSPyReNet (ACCV 2022).
Install
# via pypi
pip install transparent-background
# locally
pip install . e
Usage
Command Line
transparent-background --source [SOURCE] --dest [DEST] --type [TYPE]
--source [SOURCE]: Specify your data in this argument.- Single image -
image.png - Folder containing images -
path/to/img/folder - Single video -
video.mp4 - Folder containing videos -
path/to/vid/folder
- Single image -
--dest [DEST](optional): Specify your destination folder. If not specified, it will be saved in current directory.--type [TYPE]: Choose betweenmapgreen,rgba,blur,overlay, and another image file.rgbawill generate RGBA output regarding saliency score as an alpha map. Note that this will not work for video input.mapwill output saliency map only.greenwill change the background with green screen.blurwill blur the background.overlaywill cover the salient object with translucent green color, and highlight the edges.- Another image file (e.g.,
backgroud.png) will be used as a background, and the object will be overlapped on it.
Python API
- Usage Example
from PIL import Image
from transparent_background import Remover
remover = Remover()
img = Image.open('figures/sample.jpg')
# default setting - transparent background
out = remover.process(img)
Image.fromarray(out).save('output.png')
# object map only
out = remover.process(img, type='map')
Image.fromarray(out).save('output.png')
# image matting - green screen
out = remover.process(img, type='green')
Image.fromarray(out).save('output.png')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file transparent-background-0.1.tar.gz.
File metadata
- Download URL: transparent-background-0.1.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9409fd54915e952ae40672dca8d8069e31581f198e08a11c1e1ebd0898643f02
|
|
| MD5 |
6375c5522a108b5dfde47bb0729e1a9d
|
|
| BLAKE2b-256 |
6105b6a2b009f29f0cb6216ef6433343e86d0b7cfb8df38ed24228977814f7cd
|
File details
Details for the file transparent_background-0.1-py3-none-any.whl.
File metadata
- Download URL: transparent_background-0.1-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
486f4380e5369d385d603e22d1979591f80500ae45bad331b78ee8cb5be73f6e
|
|
| MD5 |
fdcc3ab0364d602aae55a62537f215b6
|
|
| BLAKE2b-256 |
73d2bf886dbc0f9ff7977d264ec9c7b6cbf53907af856df69b53c6289b995e95
|