Easy image resizing, cropping, and converting for Python and Django projects.
Project description
image-magic
📸 A simple, developer-friendly Python package for resizing, cropping, and converting images.
Built on top of Pillow, but easier.
Features
- Resize by width, height, or both (auto aspect ratio)
- Crop images (left, center, right, top, bottom)
- Convert formats (PNG, JPG, etc.)
- Set resolution and sharpness
- Safe checks for valid image files
Installation
pip install imagecraft
Usage
from image_magic import resize, crop
# Resize width=800px, auto height
img = resize("upload.png", width=800)
# Crop to mobile size 1200x900, center
img = crop("landscape.jpg", size=(1200, 900), position="center")
# Save to JPG
img.save("output.jpg", format="JPEG")
- Good function signatures → make it easy to understand:
resize(path, width=None, height=None, keep_aspect=True, sharpness=1.0)
crop(path, size=(1200, 900), position="center")
convert(path, format="JPEG")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
imagecraft-0.1.0.tar.gz
(2.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file imagecraft-0.1.0.tar.gz.
File metadata
- Download URL: imagecraft-0.1.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab8250df6c76c52908db25cfd7b759637d31cefcf2a99633fa3e57822ed965fb
|
|
| MD5 |
0e1c826fbb0f576fb850bd834754fccf
|
|
| BLAKE2b-256 |
a6cc78ee088cc25a2a6c9f5e2251ff3eed59ced0620c1499e696e108d51303d1
|
File details
Details for the file imagecraft-0.1.0-py3-none-any.whl.
File metadata
- Download URL: imagecraft-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c09524a1d2d2d07c5285f4349f115cc38541216aeb3eff2415f45b9d8046752
|
|
| MD5 |
435ad29fa9c5fdf4bbaff22519741ff8
|
|
| BLAKE2b-256 |
edae9b3c75ec3af4324264a45f7f9b98204d979a0b0bdd0ca790b1aa16fd126c
|