A module to handle different formats of image input
Project description
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.")
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
File details
Details for the file universal_image_input_handler-0.1.0.tar.gz
.
File metadata
- Download URL: universal_image_input_handler-0.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf4858cfef0b1f4da8e7cbb9ea64e43557d179ca93dad575e6b87c2d1330ddb4 |
|
MD5 | 86647865607b8982067c8419e418b33c |
|
BLAKE2b-256 | 5c08352951e1d7944bb9c19ec280faa40a5304c4c999d2c037215128e13c2412 |
File details
Details for the file universal_image_input_handler-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: universal_image_input_handler-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdd11fce3d419e95a568bb4eaf9975b34315728968aa9455af5d7d01287c32e5 |
|
MD5 | 2c4183ec5371cb08a35c7032cc0562b1 |
|
BLAKE2b-256 | f7629d5469e7c2796db7f7becf2a523be04c5b380bb955041ae89614e9b16890 |