Porting existing PIL-based code to PillowΒΆ

Pillow is a functional drop-in replacement for the Python Imaging Library. To run your existing PIL-compatible code with Pillow, it needs to be modified to import the Image module from the PIL namespace instead of the global namespace. Change this:

import Image

to this:

from PIL import Image

The _imaging module has been moved. You can now import it like this:

from PIL.Image import core as _imaging

The image plugin loading mechanism has changed. Pillow no longer automatically imports any file in the Python path with a name ending in ImagePlugin.py. You will need to import your image plugin manually.

This Page

Need help?

You can seek realtime assistance via IRC at irc://irc.freenode.net#pil. You can also post to the Image-SIG mailing list. And, of course, there's Stack Overflow.

If you've discovered a bug, you can open an issue on Github.