

How to use the Python Imaging Library - compcm
http://www.pythonforbeginners.com/modules-in-python/how-to-use-the-python-imaging-library/

======
AbsoluteDestiny
An article posted 7th Nov 2013 should not be recommending use of PIL (a dead
project) over Pillow, imo. The only reference to Pillow in the article is a
link at the bottom to the Pillow tutorial.

~~~
wiredfool
I'm a maintainer for pillow. Feel free to ask any questions.

(I'm not sure PIL is a dead project. It's just resting. Beautiful plumage
through)

~~~
chrismmccomas
I know Django isn't end all, be all, but with them moving forward towards 1.8
where PIL will be completely depreciated, that's really the first nail in the
coffin for PIL.

~~~
wiredfool
It's also filtering into the distro packaging -- I think it's in debian
unstable, ubuntu as of raring, and fedora ~19.

------
trurl42
When drawing something from scratch, I found Pycairo to be much more useful.

[http://cairographics.org/pycairo/](http://cairographics.org/pycairo/)

------
thatthatis
This is missing step one: use Pillow instead of PIL

------
dahart
Love PIL/Pillow, for just about the easiest image I/O there is.

I've been using it recently and needed a bit more industrial strength and
speed than the library provides. PIL supports converting an image to/from a
NUMPY array! (And the execution speed difference is definitely worth the
effort...)

Now my template for a new PIL script looks like this (all error checking
removed for simplicity):

from PIL import Image

import numpy as np

im = Image.open(args.input)

rgb8 = np.array(im)[...,:3]

rgb = rgb8.astype('float') / 256.

# ... do stuff to 'rgb' using np

rgb8 = np.clip(rgb * 256., 0, 255).astype('uint8')

im = Image.fromarray(rgb8)

im.save(args.output)

------
idbentley
People should consider checking out Wand as well. Really nice wrapper around
ImageMagick. Very good pythonic interface.

------
infocollector
PIL is dead. How did this get 14+ points?

~~~
Spiritus
Because the actual content of the article is interesting, it's as applicable
to Pillow as it is to PIL.

------
tedunangst
Unreadable in mobile safari. The text is jammed into one skinny column that's
so tiny it can't even word wrap effectively. It breaks lines in the middle of
words. How and why do people keep going out of their way to make websites
unreadable on phones?

~~~
pawn
One hardly needs to go out of their way to make a page unreadable in one
browser. Developing proper CSS to support cross-browser, mobile-friendly
websites to this day still isn't common knowledge for all developers. And it's
almost impossible for most people to test their site across different mobile
platforms themselves.

For example, this website looks fine on my Windows phone. I'd have no idea his
website had an issue if you hadn't mentioned it. If I had been particularly
impressed by the way his site looked, I might have been tempted to borrow his
CSS and propagate the problem without realizing the problem was there.

~~~
tedunangst
I wish people would simply not bother being mobile friendly if they can't do
it right. I have no trouble reading desktop oriented sites on my phone. Maybe
it's cumbersome, but at least I can zoom and pan. It's only when people dick
around with fixed viewports and disabled zoom that I have issues.

------
compcm
Thanks for all the comments. I should obviously have used Pillow instead of
PIL. This is the first time that I'm using a graphical library in Python. I
hope to find the time to update the current post or write a new one that will
address this.

