Re:How to use the Python Imaging Library
by AbsoluteDestiny on Thursday November 07, 2013 @10:52AM
(#6690008)
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.
Re:How to use the Python Imaging Library
by temuze on Thursday November 07, 2013 @11:16AM
(#6690189)
Upvote for Pillow. For those of you who don't know, Pillow is a fork of PIL that is:
- Pip/setuptools compatible
- Python 3 compatible
- Has more regular releases.
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.
Re:How to use the Python Imaging Library
by chrismmccomas on Thursday November 07, 2013 @11:30AM
(#6690298)
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.
Re:How to use the Python Imaging Library
by wiredfool on Thursday November 07, 2013 @12:08PM
(#6690568)
No one's asked for it that I've heard, so it's not in the plans.
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.
Re:How to use the Python Imaging Library
by fsckin on Thursday November 07, 2013 @05:02PM
(#6692741)
Not directed at you, but why do camera makers continue to reinvent RAW formats for new models? Isn't this a 'solved' problem with Adobe's DNG being royalty free and all?
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.
Re:How to use the Python Imaging Library
by wiredfool on Thursday November 07, 2013 @05:24PM
(#6692865)
There are many rants about that. It's not so much that the formats change, it's that they keep adding tags that mean something within the formats. Oddly enough, of the ones that I've looked at, they can (generally) be interpreted as a tiff file if you squint at them correctly. (not that a tiff file is any better. It's not called Thousands of Incompatible File Formats for nothing).
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)
Re:How to use the Python Imaging Library
by wiredfool on Friday November 08, 2013 @12:03PM
(#6697399)
I just found libraw yesterday. Looks interesting, and I have no objection to pulling it in as an optional dependency. Pull requests accepted. :>
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.
Re:How to use the Python Imaging Library
by e12e on Friday November 08, 2013 @11:33PM
(#6700684)
I make no promises :-/
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).
Re:How to use the Python Imaging Library
by est on Thursday November 07, 2013 @07:32PM
(#6693601)
> I'd consider adding DNG if there's a good external library.
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.
Re:How to use the Python Imaging Library
by wiredfool on Friday November 08, 2013 @12:09PM
(#6697447)
I'd prefer one library that works across all three major platforms, but if someone wants to send a pull request to add os dependent ones, I'd check those out.
Re:How to use the Python Imaging Library
by holyjaw on Thursday November 07, 2013 @12:34PM
(#6690806)
I tried to install PIL the other day via `pip` I believe, and a warning appeared basically saying PIL is not being maintained (is dead), use an alternative.
Re:How to use the Python Imaging Library
by truncate on Thursday November 07, 2013 @04:18PM
(#6692468)
I'm curious what problems you faced with PIL on Pip. I never tried installing it before today at work on Travis using Pip. Despite of all system libraries (jpeg-dev, zlib-dev) installed it would complain about libraries not being present and compiled without png/jpeg... support.
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.
Re:How to use the Python Imaging Library
by dahart on Thursday November 07, 2013 @05:31PM
(#6692903)
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):
Re:How to use the Python Imaging Library
by tedunangst on Thursday November 07, 2013 @02:08PM
(#6691659)
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?
Re:How to use the Python Imaging Library
by pawn on Thursday November 07, 2013 @02:28PM
(#6691802)
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.
Re:How to use the Python Imaging Library
by tedunangst on Thursday November 07, 2013 @04:06PM
(#6692390)
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.
Re:How to use the Python Imaging Library
by compcm on Thursday November 07, 2013 @03:28PM
(#6692158)
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.
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)
http://www.libraw.org/ http://freeimage.sourceforge.net/
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.
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)
http://cairographics.org/pycairo/
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.