Skip to main content

Python Imaging Library (fork)

Project description


Pillow is a “friendly” fork of the Python Imaging Library. The goal is to see if any improvement can be made to the packaging situation(*) by opening up development to the “public” and exploring the problem within the fork.

Please email: if you’d like to help, or complain.

(*) PIL aims to support the ‘import Image’ statement which will fail whenever there is another ‘Image’ module in the top level namespace.

For PIL’s README, check out PIL.txt

Build instructions (all platforms)

For a list of changes in this release, see the CHANGES document.

If you’re in a hurry, try this:

$ tar xvfz Imaging-1.1.7.tar.gz
$ cd Imaging-1.1.7
$ python install

If you prefer to know what you’re doing, read on.


If you need any of the features described below, make sure you have the necessary libraries before building PIL:

feature              library
JPEG support         libjpeg (6a or 6b)


PNG support          zlib (1.2.3 or later is recommended)


OpenType/TrueType    freetype2 (2.3.9 or later is recommended)

CMS support          littleCMS (1.1.5 or later is recommended)

If you have a recent Linux version, the libraries provided with the operating system usually work just fine. If some library is missing, installing a prebuilt version (jpeg-devel, zlib-devel, etc) is usually easier than building from source. For example, for Ubuntu 9.10 (karmic), you can install the following libraries:

sudo apt-get install libjpeg62-dev
sudo apt-get install zlib1g-dev
sudo apt-get install libfreetype6-dev
sudo apt-get install liblcms1-dev

If you’re using Mac OS X, you can use the ‘fink’ tool to install missing libraries (also see the Mac OS X section below).

Similar tools are available for many other platforms.

To build under Python 1.5.2, you need to install the stand-alone version of the distutils library:

You can fetch distutils 1.0.2 from the Python source repository:

svn export

For newer releases, the distutils library is included in the Python standard library.

NOTE: Version 1.1.7 is not fully compatible with 1.5.2. Some more recent additions to the library may not work, but the core functionality is available.

If you didn’t build Python from sources, make sure you have Python’s build support files on your machine. If you’ve down- loaded a prebuilt package (e.g. a Linux RPM), you probably need additional developer packages. Look for packages named “python-dev”, “python-devel”, or similar. For example, for Ubuntu 9.10 (karmic), use the following command:

sudo apt-get install python-dev

When you have everything you need, unpack the PIL distribution (the file Imaging-1.1.7.tar.gz) in a suitable work directory:

$ cd MyExtensions # example
$ gunzip Imaging-1.1.7.tar.gz
$ tar xvf Imaging-1.1.7.tar

Build the library. We recommend that you do an in-place build, and run the self test before installing.:

$ cd Imaging-1.1.7
$ python build_ext -i
$ python

During the build process, the will display a summary report that lists what external components it found. The self- test will display a similar report, with what external components the tests found in the actual build files:

*** TKINTER support not available (Tcl/Tk 8.5 libraries needed)
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE support available

Make sure that the optional components you need are included.

If the build script won’t find a given component, you can edit the file and set the appropriate ROOT variable. For details, see instructions in the file.

If the build script finds the component, but the tests cannot identify it, try rebuilding all modules:

$ python clean $ python build_ext -i

If the and commands finish without any errors, you’re ready to install the library:

$ python install

(depending on how Python has been installed on your machine, you might have to log in as a superuser to run the ‘install’ command, or use the ‘sudo’ command to run ‘install’.)

Additional notes for Mac OS X

On Mac OS X you will usually install additional software such as libjpeg or freetype with the “fink” tool, and then it ends up in “/sw”. If you have installed the libraries elsewhere, you may have to tweak the “” file before building.

Additional notes for Windows

On Windows, you need to tweak the ROOT settings in the “” file, to make it find the external libraries. See comments in the file for details.

Make sure to build PIL and the external libraries with the same runtime linking options as was used for the Python interpreter (usually /MD, under Visual Studio).

Note that most Python distributions for Windows include libraries compiled for Microsoft Visual Studio. You can get the free Express edition of Visual Studio from:

To build extensions using other tool chains, see the “Using non-Microsoft compilers on Windows” section in the distutils handbook:

For additional information on how to build extensions using the popular MinGW compiler, see: (compiler) (build instructions) (prebuilt libraries)


1.1 - Sat Jul 31 19:58:33 EDT 2010

  • Removed setuptools_hg requirement

  • Clarify the “PIL problem” in README

1.0 - Fri Jul 30 23:12:21 EDT 2010

  • Forked PIL [aclark]

  • Re-packaged PIL to prevent ‘import Image’ from working [Hanno Schlichting]

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Pillow-1.1.tar.gz (511.0 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page