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.)
Metadata
Release files for pilkit 3.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 | Provenance | Actions |
|---|---|---|---|---|
| pilkit-3.0.tar.gz | 402.3 kB | Without provenance | Details for pilkit-3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pilkit-3.0-py3-none-any.whl | Python 3 | none | any | Details for pilkit-3.0-py3-none-any.whl |
Total release size: 422.4 kB
Release files / pilkit-3.0.tar.gz
| Download URL | pilkit-3.0.tar.gz |
|---|---|
| Size | 402.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f6719e8cc0482e5447f5cb94f18b949d8e604ea9673a9b019c74d41b779e4eab
|
|
BLAKE2b-256 checksum How to use checksums |
b9a5bbe12d2c9dc06e29224c45a2cd7aa0ce923648588b6a15aadfee150bbd0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / pilkit-3.0-py3-none-any.whl
| Download URL | pilkit-3.0-py3-none-any.whl |
|---|---|
| Size | 20.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe1707b0411a1d0cbf9ad3986779fa5a346cec4582a188740924aa39f504d117
|
|
BLAKE2b-256 checksum How to use checksums |
deec877b84b82cbcba6203e39d068cecfdbcfb61de69260cb851ea11be9b67f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Security for pilkit 3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.