DeepAI PNG
This command-line utility processes images by resizing, cropping to fit specified dimensions, making the background transparent, and can be extended to perform other tasks. It leverages the DeepAI Background Remover API and Python's Pillow library for image manipulations.
Features
- Resize and Crop: Adjusts the size of the image to maintain aspect ratio and ensures it fits within a specified square dimension.
- Background Removal: Uses DeepAI's Background Remover API to make the image background transparent.
- Command-Line Interface: Offers a straightforward command-line interface for easy usage in various environments.
Requirements
- Python 3.10 or higher
Installation
DeepAI PNG can be installed easily with pip:
pip install deepaipng
You also need to obtain an API key from DeepAI. Set this API key in your environment as DEEPAI_API_KEY or pass it directly to the script if modified to accept it as an argument.
Usage
To process an image, specify the input and output file paths, and optionally the target size. Run DeepAI PNG from the command line:
python -m deepaipng --input_path 'path/to/input.jpg' --output_path 'path/to/output.png' --size 120
Arguments
input_path: Path to the input image file.output_path: Path to save the output image file.-s,--size: Optional. Target size for the output image's width and height in pixels. Defaults to 120.
Configuration
Set your DeepAI API key in your environment to avoid passing it directly with your scripts.
Use the .env file for local development:
DEEPAI_API_KEY=your_api_key_here
Always keep your API keys secure and avoid committing them to version control. You are responsible for any unauthorized usage of your DeepAI API key.
Load this environment variable with dotenv when the script runs.
Author
License
This project is licensed under the ISC License - see the LICENSE file for details.
Metadata
Release files for deepaipng 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| deepaipng-1.1.2.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| deepaipng-1.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.4 kB
Release files / deepaipng-1.1.2.tar.gz
| Download URL | deepaipng-1.1.2.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc9d49f4e06b4c1262de2e473c1469fbf92e4eef84a177d1fdf9c116d9f58f48
|
|
BLAKE2b-256 checksum How to use checksums |
f23c44548024e3dba032b5eaa9f6dfc8e9b16d4fb6dede493ed50e6e948e5f58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.0 Windows/10
|
Release files / deepaipng-1.1.2-py3-none-any.whl
| Download URL | deepaipng-1.1.2-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a80667998cfb9c7475be4ede691ecf340c3df7f81c70ba1e2ce1f1a667e93587
|
|
BLAKE2b-256 checksum How to use checksums |
2e7c781307b2253b0f16e8f64047866fc5a8441ff07f903e8c702efc4a39947b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.0 Windows/10
|