Libraries PIL
and Pillow
are generally considered the standard for image processing in Python. It can be confusing to understand the difference and relationship between these libraries. We attempt to clear up the confusion in this post.
PIL
?PIL (Python Imaging Library) is a powerful image processing library for Python. However the latest version of PIL was released 2009 making Python 2.7 the latest Python version with PIL support.
Pillow
?Pillow is the successor to PIL. The Pillow project started by forking the PIL repository in 2010, and added Python 3.x support in 2013. In 2020 the PIL project on PyPI was transferred to the Pillow team.
There is often confusion related when installing and using pillow but still importing from the PIL package.
pip install pillow
from PIL import Image
image = Image.open("test.jpg")
Since Pillow started as a fork of the PIL a new distribution package name (pillow) was required. However keeping the same import package name (PIL) enabled existing PIL users to switch to Pillow with little effort.