A collection of utilities and processors for the Python Imaging Libary.
Project description
PILKit is a collection of utilities for working with PIL (the Python Imaging Library).
One of its main features is a set of processors which expose a simple interface for performing manipulations on PIL images.
Looking for more advanced processors? Check out Instakit!
For the complete documentation on the latest stable version of PILKit, see PILKit on RTD.
Installation
Usage Overview
Processors
The “pilkit.processors” module contains several classes for processing PIL images, which provide an easy to understand API:
from pilkit.processors import ResizeToFit
img = Image.open('/path/to/my/image.png')
processor = ResizeToFit(100, 100)
new_img = processor.process(img)
A few of the included processors are:
ResizeToFit
ResizeToFill
SmartResize
Adjust
TrimBorderColor
Transpose
There’s also a ProcessorPipeline class for executing processors sequentially:
from pilkit.processors import ProcessorPipeline, ResizeToFit, Adjust
img = Image.open('/path/to/my/image.png')
processor = ProcessorPipeline([Adjust(color=0), ResizeToFit(100, 100)])
new_image = processor.process(img)
Utilities
In addition to the processors, PILKit contains a few utilities to ease the pain of working with PIL. Some examples:
- prepare_image
Prepares the image for saving to the provided format by doing some common-sense conversions, including preserving transparency and quantizing.
- save_image
Wraps PIL’s Image.save() method in order to gracefully handle PIL’s “Suspension not allowed here” errors, and (optionally) prepares the image using prepare_image
Utilities are also included for converting between formats, extensions, and mimetypes.
Community
Please use the GitHub issue tracker to report bugs. A mailing list also exists to discuss the project and ask questions, as well as the official #imagekit channel on Freenode. (Both of these are shared with the django-imagekit project—from which PILKit spun off.)
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
File details
Details for the file pilkit-1.1.8.tar.gz
.
File metadata
- Download URL: pilkit-1.1.8.tar.gz
- Upload date:
- Size: 874.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56e89ca7ab931c3945821e7e902194b380ee9293024b27072bbb9850d923528a |
|
MD5 | d0aec1f8d3c3deaeac9d8ded6c98d928 |
|
BLAKE2b-256 | 9889f73b364dbd3b2c4448b818f34acf2950a5aa6e3ed859bf7025c87bb80e6c |