Deborah R. Fowler
Python Image Library
Updated April 28 2024
PIL (now Pillow) Python Image Library
is a wonderful addition to python if you want to manipulate
images. Much like the openGL instructions, the
official versions were not compatible on my system, however
using the site below this successfully installed. This allows
you to manipulate image files in almost all the common formats
(png, jpg etc.). (There is a similar library that can be used
called OpenCV
as well).
Note that PIL is what you used for your import
but the official name of the library is now pillow.
- I have multiple versions on my computer so I had to use the
full path. If you type in pip install without the full path it
may work. If it doesn't you can also add the Scripts directory
to you environment variable paths or type the full path as
above. It would then be
pip install --upgrade pip
pip install --upgrade Pillow
- NOTE - most users on Windows will have Python installed in
the path above, however I did have one student who installed
on D drive so the path differed. Use the path and version
appropriate.
- sample file here (to test this you will need to change the image to something you have available)
- documentation
- For mac users (tested April 2024), the pip install is straightforward
- Open a terminal window and type as
per the documentation
python3 -m pip install - - upgrade pip
python3 -m pip install - - upgrade Pillow
- For linux users (tested April 22 2022 on Centos7), same pip install as above
- python3 -m pip install --upgrade pip
- python3
-m pip install --upgrade Pillow