Pillow, actively developed and (mostly) python3 compatible PIL (python-imaging)
manisandro at gmail.com
Sun Dec 23 02:45:46 UTC 2012
Working on a python project using PIL, and wanting to port it to
python3, I got bitten by the absence of a python3 compatible PIL. Doing
some research, there seems to be an actively developed PIL fork, called
Pillow, which can be found here . It describes itself as
Pillow is the "friendly" PIL fork. PIL is the Python Imaging Library.
started for and is currently maintained by the Plone community. But it
is used by
many other folks in the Python web community, and probably elsewhere too.
The fork author's goal is to foster packaging improvements via:
- Publicized development and solicitation of community support.
- Exploration of packaging problems within the fork, most noticably
via adding setuptools support but also via clean up & refactoring
of packaging code.
Now, the PIL project has been rather inactive lately (last release in
2009), and there seems to be some general agreement that Pillow is a
likely candidate to succeed PIL, and in particular to bring python3
support see the discussion at  and . Now, there already seems to
have been some discussion about adopting it in Fedora (at least, it was
mentioned in ), and I'd like to bring up the issue again.
I've packaged the latest Pillow release (1.7.8) here , based on the
python-imaging package, and the state is the following
- Compiles for both python2 and python3, both variants pass the self-tests
- Python 3 support is all upstream code, except for pysane, which I
needed to patch (and I'll propose the changes upstream once github is
- Python 2 looks like a drop-in replacement for PIL, except that you
need to write i.e. "from PIL import Image" instead of directly "import
Image" (the latter was allowed only by a PIL.pth file in the
site-packages dir, and looked like a hack anyway - with the changes for
python3 compatibility, the files in the PIL directory use relative
imports, and hence the "import Image" does not work anymore, one could
still patch away the relative imports in the python2 variant for 100%
- Note: because of what I think is a nasty python3-distutils bug
(shared-library extension incorrect, see ) I needed to patch a file
in the python3 distutils modules for the package to compile, see .
So, since Pillow seems to be the most likely candidate for
python3-imaging, the questions are:
- Do we want Pillow to succeed PIL in Fedora?
* According to , it is likely that Pillow will soon become an
"unfriendly fork" of PIL, so Pillow-PIL compatibility is likely to break
in the future
* But still being compatible at the moment, I'd say it would be
easier to make the transition now
- Python2 and 3, or only the python-3 variant?
- Plus some packaging questions for the maintainers (I could co-maintain
* Keep the package name?
* Need new review request?
More information about the devel