How to use the Python Imaging Library
pythonforbeginners.com
pythonforbeginners.com
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.
When I got a D800 around launch time, even Lightroom didn't have the capability to import them directly at launch and I had to convert them to DNGs first. What a bloddy mess.
But once you have that file format, camera manufacturers tend to embed hunks of data in the raw file about settings and other things that the camera knows about the image, like the focus points, white balance, camera calibration, image compression, dot layout and all that.
I'd like to leave that as Someone Else's Problem. (unless there's a lot of money and shiny cameras in it for me)
Freeimage looks like more than we'd need, and includes libraw. And actually, looks like it does a lot of the same things that Pillow does, wrt to various image formats.
Surprised you weren't aware of libraw (assuming DNG/RAW has been a requested feature for Pillow) -- but great it's on your radar now. FWIW libraw does an excellent job of handling RAW/DNGs -- as far as I know it's still the best tool for that (including various closed tools).
I'd known about dcraw from a ways back, just not the libraw fork.
Can you guys just call OS libraries? There are RAW librarys available for Windows and OS X. A thin wrapper would be nice. I really hate to compile >20MB external shared libraries myself.
pillow works fine with pip.
(though, it doesn't support py<=2.5)
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.
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.