• Stars
    star
    195
  • Rank 198,178 (Top 4 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created over 11 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Utilities and processors built for, and on top of PIL

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

  1. Install PIL or Pillow.
  2. Run pip install pilkit (or clone the source and put the pilkit module on your path)

Note

If you've never seen Pillow before, it considers itself a more-frequently updated "friendly" fork of PIL that's compatible with setuptools. As such, it shares the same namespace as PIL does and is a drop-in replacement.

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.)

More Repositories

1

django-imagekit

Automated image processing for Django. Currently v4.0
Python
2,259
star
2

python-markdownify

Convert HTML to Markdown
Python
959
star
3

react-controllables

Easily create controllable components
JavaScript
256
star
4

monorouter

An isomorphic JS router
JavaScript
141
star
5

react-mediaswitch

Choose your DOM based on media queries
CoffeeScript
59
star
6

react-frozenhead

Make your whole page a React component and render it on the server
JavaScript
57
star
7

django-classbasedsettings

Class based settings. You couldn't get that from the title?
Python
52
star
8

httpplease.js

The polite HTTP request library for node and the browser
JavaScript
31
star
9

django-html5boilerplate

A packaging of Paul Irish's HTML5 Boilerplate for Django projects.
Python
20
star
10

markdown-with-front-matter-loader

A webpack loader for markdown with yaml front matter (think Jekyll)
JavaScript
19
star
11

jquery-icbiacontrol

Style browser controls without losing their native behaviors.
JavaScript
12
star
12

assert-this.js

A clear assertion style that uses virtual methods instead of wrappers
JavaScript
7
star
13

grunt-jinja

A grunt plugin for compiling Jinja2 templates with James Long's nunjucks templating system
CoffeeScript
6
star
14

jquery.picplus

Take control of your images.
JavaScript
6
star
15

django-throttleandcache

Cache the results of arbitrary function calls!
Python
5
star
16

gulp-heroku-deploy-slug

Deploy slug archives to Heroku
JavaScript
4
star
17

react-template

Organized rendering.
JavaScript
3
star
18

wrapperator.js

Create a function that can be used as a wrapper or method decorator
JavaScript
2
star
19

jquery.picplus.queueup

Use a load queue to load your picplus pictures. Load the important stuff first.
JavaScript
2
star
20

jquery.picplus.lazyload

Add lazyloading to your picplus pictures. Load them when they're scrolled into your viewport.
CoffeeScript
2
star
21

httpplease-promises

A plugin that adds promise support to httpplease
JavaScript
2
star
22

monorouter-react

ReactJS tools for monorouter
JavaScript
2
star
23

django-maid

Django maid cleans up your orphaned media files.
Python
1
star
24

Google-Closure.tmbundle

The fastest way to get started with Google Closure.
JavaScript
1
star
25

jquery.parallaxin

Create an element that scrolls at a different speed than the document but always stays within a container.
JavaScript
1
star
26

django-scspostgis

A PostGIS db backend that works with standard_conforming_strings.
Python
1
star