Image Input Handler
image-input-handler is a versatile Python package designed to simplify the handling of various image inputs. It supports images from multiple sources including file paths, URLs, and base64 encoded strings. It adjusts image channels according to user needs and includes functionality for checking compatibility and enabling debug mode, making it an essential tool for projects involving image processing.
Features
- Handle images from URLs, file paths, and base64 strings.
- Automatic adjustment of image channels.
- Support for image masks.
- Compatibility checks to ensure image inputs can be processed.
- Debug mode for detailed operational logging, aiding in troubleshooting and development.
- Easy integration with popular libraries such as NumPy, OpenCV, and PIL.
Installation
Install image-input-handler using pip:
bash pip install image-input-handler
Usage
Below is a basic example of how to use image-input-handler:
from image_input_handler import UniversalImageInputHandler
# Initialize the handler with a local file path, enabling debug mode
handler = UniversalImageInputHandler('path/to/your/image.png', debug=True)
# For URL based images
url_handler = UniversalImageInputHandler('http://example.com/image.png')
# For base64 encoded images
base64_handler = UniversalImageInputHandler('base64_encoded_string_here', img_is_a_mask=True)
# Access the processed image
processed_image = handler.img
# Check if the image is compatible
if handler.COMPATIBLE:
print("The image is compatible.")
else:
print("The image is not compatible.")
Metadata
Release files for universal-image-input-handler 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| universal_image_input_handler-0.1.0.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| universal_image_input_handler-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.0 kB
Release files / universal_image_input_handler-0.1.0.tar.gz
| Download URL | universal_image_input_handler-0.1.0.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf4858cfef0b1f4da8e7cbb9ea64e43557d179ca93dad575e6b87c2d1330ddb4
|
|
BLAKE2b-256 checksum How to use checksums |
5c08352951e1d7944bb9c19ec280faa40a5304c4c999d2c037215128e13c2412
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.19
|
Release files / universal_image_input_handler-0.1.0-py3-none-any.whl
| Download URL | universal_image_input_handler-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fdd11fce3d419e95a568bb4eaf9975b34315728968aa9455af5d7d01287c32e5
|
|
BLAKE2b-256 checksum How to use checksums |
f7629d5469e7c2796db7f7becf2a523be04c5b380bb955041ae89614e9b16890
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.19
|