Simple image resizing and caching using wsrv.nl service
Project description
ImgWizard
ImgWizard
is a Python package that simplifies image resizing and caching by interfacing with the wsrv.nl
service. It supports a range of image formats and manipulations, making it an ideal tool for developers needing to dynamically adjust images in their applications.
Installation
To install ImgWizard
, you can use pip:
pip install imgwizard
Usage
ImgWizard
is designed to be intuitive and easy to use. Here's a quick start example:
from imgwizard import ImgWizard
img = ImgWizard('https://i.ibb.co/tHzGgg9/Screenshot-2024-03-09-at-16-00-21.png')
resized_image_url = img.resize(width=300, height=300, fit='cover').fetch()
print(resized_image_url)
This example demonstrates how to resize an image to a 300x300 dimension using the cover
fit option and then fetches the URL of the processed image.
Cropping Images
You can easily crop images by specifying alignment or using a smart crop:
cropped_image_url = img.crop(alignment='top').fetch()
print(cropped_image_url)
Applying Adjustments
Apply various adjustments such as blur, contrast, and tint:
adjusted_image_url = img.apply_adjustments(blur=5, contrast=15, tint='blue').fetch()
print(adjusted_image_url)
Changing Image Format
Convert images to different formats with quality adjustments:
formatted_image_url = img.set_format(output_format='png', quality=50).fetch()
print(formatted_image_url)
Before and After Examples
Original Image:
Resized Image:
Cropped Image:
Adjusted Image:
Reformatted Image:
Features
- Supports resizing, cropping, and various image adjustments such as blur, contrast, and tint.
- Easy integration with Python projects for dynamic image manipulation.
- Leverages the global caching and delivery capabilities of Cloudflare via
wsrv.nl
.
Contributing
Your contributions are welcome! If you have suggestions or issues, please feel free to open an issue or submit a pull request on the GitHub repository.
License
ImgWizard
is available under the MIT License. Feel free to use it in your projects and contribute back to the open-source community.
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 imgwizard-0.0.1.tar.gz
.
File metadata
- Download URL: imgwizard-0.0.1.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64042ebb8ee8371fac2edaa51782a0e2e2bd92c235fdc9d0620370d6fe9c1eee |
|
MD5 | a563443225264e1cff6022ad51a26170 |
|
BLAKE2b-256 | 44451487beea2bdae1c565a10f06c2d57140d97023885c0bfccdcc7ce661d38f |
File details
Details for the file imgwizard-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: imgwizard-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80ebb5618357c42b8fecb6f671ff3db5283103e367eb33433cf6271aed8a6d33 |
|
MD5 | 460fe43a741cfe501220a745d6e3af5d |
|
BLAKE2b-256 | c3868859044da1abfa7cd069abea26cff3fbbc4e2c790784e53cf0798e7a8975 |