Python SDK for pixian.ai.
Remove image backgrounds.
$ pip install pixian-ai
from pixian_ai import PixianAI
client = PixianAI(
api_id="PIXIAN-AI-API-ID",
api_secret="PIXIAN-AI-API-SECRET",
)
img = client.remove_background("/path/to/input.jpeg")
img.save("/path/to/output.jpeg")
You can also use:
client.remove_background(image_base64="base64encodedimage==")
# or
client.remove_background(image_url="https://imageurl.com/test.jpeg")
client.remove_background(
image_path="/path/to/image.jpeg",
max_pixels=100,
background_color="#0055FF"
...
)
Reference: https://pixian.ai/api
All parameters described in the API spec above replace period (.
) with underscore (_
). For example, if the parameter is background.color
, the SDK will use background_color
.
Feel free to open a PR for any changes!
$ python -m unittest discover -s tests -p 'test_*.py'
Made with ❤️ by @mitchbregs