Python Forum
Shoud we use PIL or Pillow?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shoud we use PIL or Pillow?
#1
Which of the two should we use and why?

My Kubuntu 22.04 OS comes with python3-pil installed. Can I install python3-pillow and use both of them?
Reply
#2
You only use Pillow.
Original maintainers of the PIL stopped working on it a long time⏲ ago.
Pillow is repackaged(drop-in replacement) and much updated version of original PIL
Still use PIl in import as in original just to keep backward compatible.
from PIL import Image

img = Image.open('image.png').convert('L')
img.save('greyscale.png')
Gribouillis Wrote:My Kubuntu 22.04 OS comes with python3-pil installed. Can I install python3-pillow and use both of them?
I would not use OS install at all,they may not be updated.
Just use pip.
pip install Pillow --upgrade
Gribouillis likes this post
Reply
#3
(Aug-12-2022, 02:08 PM)snippsat Wrote: Just use pip.
I did that and it seems to work well
Output:
λ python -m pip install Pillow --upgrade Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: Pillow in /usr/lib/python3/dist-packages (9.0.1) Collecting Pillow Downloading Pillow-9.2.0-cp310-cp310-manylinux_2_28_x86_64.whl (3.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 8.8 MB/s eta 0:00:00 Installing collected packages: Pillow Successfully installed Pillow-9.2.0 λ python Python 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import PIL >>> PIL <module 'PIL' from '/home/eric/.local/lib/python3.10/site-packages/PIL/__init__.py'> >>> λ python -m PIL -------------------------------------------------------------------- Pillow 9.2.0 Python 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0] ...
snippsat likes this post
Reply
#4
(Aug-12-2022, 02:45 PM)Gribouillis Wrote: I did that and it seems to work well
Works fine🎈
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020