Rembg is a tool to remove images background. That is it.
Install it from pypi
pip install rembg
Remove the backaground from a remote image
curl -s http://input.png | rembg > output.png
Remove the backaground from a local file
rembg -o path/to/output.png paht/to/input.png
Remove the backaground from all images in a folder
rembg -p path/to/inputs
Start the server
rembg-server
Open your browser to
http://localhost:5000?url=http://image.png
In app.py
import sys
from rembg.bg import remove
sys.stdout.buffer.write(remove(sys.stdin.buffer.read()))
Then run
cat input.png | python app.py > out.png
Copyright (c) 2020-present Daniel Gatis
Licensed under MIT License