78 points · by compcm · 13y ago · 33 comments
This is a great example of what to do when an open source project is getting behind on the times. PIL was having bi-year releases and installation was a headache, so someone forked it and made it better.
(I'm not sure PIL is a dead project. It's just resting. Beautiful plumage through)
I'd consider adding DNG if there's a good external library. The individual camera raws, that's more of a thankless task with how fast they change/multiply.
pillow works fine with pip.
http://pillow.readthedocs.org/en/latest/
It's amusing to me that he ignores pillow for the whole piece and then links to the tutorial I ported to the pillow docs from the PIL handbook just a few weeks ago.
(though, it doesn't support py<=2.5)
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)
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.