Saturday, June 8, 2024

How do you install Python Image Library for PyCharm?

 PIL, or Python Image Library provides support for working with images in Python (Interpreter). PIL provides a fairly fast and powerful way to process images.

You may also come across Pillow. Pillow (a fork of PIL) is same as PIL, and it was created since PIL was not supported since 2009.You use Pillow wherever you need PIL. Pillow is supported by active developers.

Importantly Pillow provides,

File format support.

Image processing capabilities.

In an earlier post we have seen many of the desirable features of PyCharm. Other libraries for processing images in Python are OpenCV and matplotlib.

PIL Installation:

Using PIP, PIL can be installed. Installing Pillow (or PIL) is easy and with a simple command,

pip install Pillow

However, you may have to use it with caution.

PIL,  or Pillow with PyCharm:

If you have PyCharm installed, it is fairly easy to install PIL. The highligted in blue is the node for Phyton Packages.


You find Pillow at the end of the listt of packages available in this node.


If you click Install (blue lin) it opens a drop-down list as shown.


From PIL 1.0 to 10.3.0 versions can be installed. What is the best version then? It would be the latest since Pillow is maintained with all bug fixes. If you need to work with older projects you may need to dig a little deeper as there may be compatibility issues with Python versions.

Herein the latest version will be used and if some problems arise other versions may be considered.

Clicking on 10.3.0 installs this version of Pillow. Easy, isn't it?


How do you check if Pillow is installed?

Just try to run the following code from the Python Console shown in blue, 

from PIl import Image

You should see the success of your code.

Visit again for more PyCharm and PIL.

No comments: