Questions tagged [python-imaging-library]

The Python Imaging Library (PIL) provides the Python language with a de-facto standard foundation for image work. PIL’s API is lightweight but semantically consistent; it furnishes a range of comfortably Pythonic tools throughout much of the imaging lexicon: processing, analysis, compression and codec abstraction, etc. – all of which builds upon a bespoke and readily extensible library structure.

The Python Imaging Library (PIL) provides the Python language with a de-facto standard foundation for image work.

PIL’s API is lightweight but semantically consistent. It furnishes a range of comfortably Pythonic tools, whose top-level hierarchy covers a broad lexical range of the imaging fields’ usual suspects, including: pixel and channel processing; statistical analysis; affine, Gaussian, and kernel transforms, abstraction for compressors, binary formats, codecs, and the like; vector drawing and typesetting; pixel mathematics and color correction; matrices; programming and I/O paradigms. Each of these is notionally organized into a Python sub-package and implemented with an API in a mode whose form is germane to its concept – e.g. while the IO modules like PIL.Image and PIL.ImageFile generally follow along with the Python standard libraries — they employ OO-style conventions that very similar throughout – PIL is not pedantic in this way, as other submodules are non-uniform when they need to be… PIL.ImageFilter, for example, is written in a functional style (obfuscated slightly, due to having been CamelCased). And PIL.ImageMath exposes its interface as a little subset of Python language itself, with which the programmer can tersely and legibly describe an algorithm – which PIL can then take and deterministically pipeline and vectorize into something much faster than naïve Python.However, it only supports Python 1.5.2 and newer, including 2.5 and 2.6.

More information can be found at PIL (PythonWare.com); founded and first developed by Fredrik Lundh, the original PIL codebase is open source, but unmaintained since 2011.

There is also an active, maintained and popular fork of PIL called Pillow which releases quarterly with security updates, new features and bug fixes, it supports python 3.x.

7275 questions
3
votes
2 answers

how does ImageFilter in PIL normalize the pixel values between 0 and 255 after filtering with Kernel or mask

how does ImageFilter in PIL normalize the pixel values(not the kernel) between 0 and 255 after filtering with Kernel or mask?(Specially zero-summing kernel like:( -1,-1,-1,0,0,0,1,1,1 )) my code was like: import Image import ImageFilter Horiz =…
Alok Nayak
  • 1,904
  • 19
  • 26
3
votes
1 answer

Interpolation and image drawing

In my little project I have a function that returns a list of points coordinates. Like this: points = [(x1, y1), (x2, y2),...] When I draw it on image, I get points on image but I want continious line. How can I get it? And how to draw…
milssky
  • 143
  • 7
3
votes
2 answers

Python Tkinter rotate image animation

I have a PhotoImage that I created using PIL and then added to a TKinter canvas. The image shows up fine. However, I can't get the PIL rotate function to work correctly. Here is my code: #This works fine image = Image.open('img.png') …
Mason
  • 6,345
  • 15
  • 67
  • 113
3
votes
2 answers

Using PIL to draw image on App Engine

I have read the topic "App Engine, PIL and overlaying text". The code below will show a broken image, how should I correct that? class TestImg(webapp2.RequestHandler): def get(self): text_img = Image.new('RGBA', (800,600), (0, 0, 0, 0)) …
3
votes
2 answers

How may i install the Python Imaging Library to django environment?

I am currently finding it hard to install PIL on precise pangolin. I have followed this tutorial (http://www.sandersnewmedia.com/why/2012/04/16/installing-pil-virtualenv-ubuntu-1204-precise-pangolin/) When I do: pip install PIL I get the…
Suziemac Tani
  • 455
  • 7
  • 22
3
votes
1 answer

Recommendations for backend image processing in Python

On my site I'm using simple text overlay. Inputs come from textboxes and then javascript makes an AJAX call with the inputs that are then processed in the backend by PIL (Python Imaging Library). Thing is, I'm not happy about the quality of PIL's…
teeZee
  • 827
  • 1
  • 8
  • 7
3
votes
1 answer

Fade between images on screen using Python TKinter / imageTK

I am a python newbie and have been making a somewhat odd slideshow script that cycles through images and also sources a variable from another file to 'settle' on an image. I'm sure my code is tragic. But it does work (see below)! My question is -…
Staple
  • 672
  • 1
  • 10
  • 19
3
votes
1 answer

pip, PIL and Pillow

I ran the following command to install project dependencies into virtualenv novacek: (novacek) $ pip install -r reqs.txt reqs.txt looks like…
clime
  • 7,872
  • 8
  • 52
  • 80
3
votes
4 answers

App Engine image resize without maintaining aspect ratio?

When I call resize on images using app engine, they maintain their aspect ratio - I don't end up with the size I ask for. I'm trying to make rectangular pixel NTSC images from square pixel sources, so I don't want this behaviour I want to take an…
3
votes
1 answer

Incorrect red pixel values of saved picture Python

I have a multidimensional array of the red pixels in the picture. And I'm adjusting it to make a new picture using the new red pixels that I have changed. I'm still keeping the blue and green and I'm not changing those. When I print out the red…
Calvin Jones
  • 357
  • 6
  • 18
3
votes
3 answers

Image processing using Python and SciPy

I am trying to do image processing with Python. What I actually want to do is I have image with human and I need to indetify human faces or detect circle (basically human face). what I have done so far us I have done edge detection for image using…
user2096230
  • 57
  • 1
  • 5
3
votes
1 answer

Checking if an image format is Lossless in Python?

I am working on an application that requires images submitted to it to be lossless. Currently I am opening the image with PIL and checking if the "format" attribute is a lossless format. This requires me to manually keep a list of formats, and I…
3
votes
3 answers

PIL selftest.py fails for Centos 6 64-bit Error: Jpeg Decoder not Available

I am having difficulty on my server trying to get the selftest.py to run successfully. I am trying to get PIL 1.1.7 working with Python 2.4.4 (Are the versions compatible?) When the install is preformed like so: # python2.4 setup.py install running…
Mallow
  • 764
  • 1
  • 11
  • 33
3
votes
1 answer

What is difference between PIL and ImageMagick bindings for python?

I research different ways for scale images (creating thumbnails) using python. Can anybody explain me fundamental difference in result images after ImageMagick process and after PIL process. At first sight there is no any full-featured ImageMagick…
Dmitry
  • 217
  • 4
  • 13
3
votes
2 answers

installing libjpeg for pil and Google app engine on mac Mountain Lion

I'm sure there's a duplicate of this somewhere out there but I looked and am about at the end of my rope. I'm trying get PIL working on my mac OS X 10.8 so that I can use dev_appserver.py to test an imaging feature. First I had trouble installing…
Harrison
  • 830
  • 1
  • 14
  • 28
1 2 3
99
100