Questions tagged [pillow]

The Pillow library is a fork of the Python Imaging Library (PIL), aiming to be friendlier than the former.

What is Python Pillow?

Pillow is the "friendly" PIL fork by Alex Clark and Contributors. PIL is the Python Imaging Library by Fredrik Lundh and Contributors.

The fork author's goal is to foster active development of PIL through:

  • Continuous integration testing via Travis-CI
  • Publicized development activity on GitHub
  • Regular releases to the Python Packaging Index
  • Solicitation for community contributions and involvement on Imaging-SIG

Source: Python Pillow library 2.0.0 on pypi.python.org.

Python Pillow library packages are available on pypi.python.org

1149 questions
304
votes
15 answers

Python Image Library fails with message "decoder JPEG not available" - PIL

PIL does support JPEG in my system. Whenever I do an upload, my code is failing with: File "PIL/Image.py", line 375, in _getdecoder raise IOError("decoder %s not available" % decoder_name) IOError: decoder jpeg not available How can I resolve…
Ravi
  • 2,432
  • 3
  • 15
  • 25
173
votes
13 answers

Fail during installation of Pillow (Python module) in Linux

I'm trying to install Pillow (Python module) using pip, but it throws this error: ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting So as the error says, I tried: pip install pillow…
mchfrnc
  • 4,324
  • 5
  • 16
  • 35
70
votes
2 answers

Open PIL image from byte file

I have this image with size 128 x 128 pixels and RGBA stored as byte values in my memory. But from PIL import Image image_data = ... # byte values of the image image = Image.frombytes('RGBA', (128,128), image_data) image.show() throws the…
Michael Dorner
  • 11,986
  • 10
  • 64
  • 95
69
votes
3 answers

How do I install PIL/Pillow for Python 3.6?

I have a script that requires PIL to run. Other than downgrading my Python, I couldn't find anyway to install PIL on my Python 3.6 Here are my attempts: pip install pil Collecting pil Could not find a version that satisfies the requirement pil…
Abdulrahman Hassoun
  • 1,101
  • 1
  • 8
  • 13
68
votes
3 answers

Getting "cannot write mode P as JPEG" while operating on JPG image

I am trying to resize some images, most of which are JPG. But in a few images, I am getting the error: Traceback (most recent call last): File "image_operation_new.py", line 168, in modifyImage tempImage.save(finalName); File…
vlad halmer
  • 941
  • 2
  • 13
  • 20
58
votes
11 answers

"The headers or library files could not be found for jpeg" installing Pillow on Alpine Linux

I'm trying to run Python's Scrapy in a Docker container based on python:alpine. It was working before, but now I'd like to use Scrapy's Image Pipeline which requires me to install Pillow. As a simplified example, I tried the following…
Kurt Peek
  • 34,968
  • 53
  • 191
  • 361
51
votes
5 answers

ImportError: Could not import the Python Imaging Library (PIL) required to load image files on tensorflow

I am doing a deep learning course on udacity. For the first assignment whenI tried to run the script which is below the problem 1 , I got this error. So I tried to uninstall PIL and pillow and then installed these individually but I didnot…
51
votes
2 answers

How do you merge images into a canvas using PIL/Pillow?

I'm not familiar with PIL, but I know it's very easy to put a bunch of images into a grid in ImageMagick. How do I, for example, put 16 images into a 4×4 grid where I can specify the gap between rows and columns?
pythonee
  • 894
  • 2
  • 11
  • 17
50
votes
17 answers

Why can't Python import Image from PIL?

The single line that I am trying to run is the following: from PIL import Image However simple this may seem, it gives an error: Traceback (most recent call last): File "C:\...\2014-10-22_12-49.py", line 1, in from PIL import Image …
49
votes
1 answer

cannot write mode RGBA as JPEG

I am learning to use 'pillow 5.0' following book 'Automate the boring stuff with python' The info about the image object In [79]: audacious = auda In [80]: print(audacious.format, audacious.size, audacious.mode) PNG (1094, 960) RGBA When I tried to…
user9062604
49
votes
5 answers

Error installing Pillow on ubuntu 14.04

I'm trying to install Pillow on Ubuntu 14.04 using this command: pip install Pillow but the installation fails with this error: ValueError: --enable-jpeg requested but jpeg not found, aborting.
Navid777
  • 3,379
  • 7
  • 37
  • 62
49
votes
2 answers

How do I close an image opened in Pillow?

I have a python file with the Pillow library imported. I can open an image with Image.open(test.png) But how do I close that image? I'm not using Pillow to edit the image, just to show the image and allow the user to choose to save it or delete it.
Chase Cromwell
  • 731
  • 1
  • 5
  • 13
48
votes
3 answers

Decoding base64 from POST to use in PIL

I'm making a simple API in Flask that accepts an image encoded in base64, then decodes it for further processing using Pillow. I've looked at some examples (1, 2, 3), and I think I get the gist of the process, but I keep getting an error where…
Lazaro Gamio
  • 659
  • 1
  • 6
  • 11
44
votes
9 answers

Error for pip install Pillow on Ubuntu virtualenv

I have an ec2 instance and had Pillow 2.0 installed in my virtualenv initially. Somehow when I tried to upgrade it to Pillow 2.5, it failed with the following message. The error is the same even after I removed Pillow completely prior to reinstall.…
Andy
  • 1,161
  • 1
  • 13
  • 25
41
votes
9 answers

PIL: DLL load failed: specified procedure could not be found

I've been beginning to work with images in Python and I wanted to start using PIL (Pillow). To install it, I ran pip install Pillow. When installing, PIL was not previously installed. I also tried uninstalling it and reinstalling it, as well as…
MLavrentyev
  • 1,629
  • 1
  • 23
  • 31
1
2 3
76 77