[SciPy-user] fromimage returns instance instead of numpy array

Zachary Pincus zpincus@stanford....
Tue Oct 9 22:19:13 CDT 2007


> PIL 1.1.6 is still broken to some extent.  I sent a patch to the Image
> SIG:
>
> http://mail.python.org/pipermail/image-sig/2007-August/004570.html
>
> Unfortunately, there was no reaction.

I sent a very similar patch a while ago, and got similar results  
(i.e. no response).

Moreover, the PIL is extremely inconsistent about its handling of 16- 
bit integer images (important for many scientific uses), and has  
various byte-swapping bugs for these on little-endian architectures.  
There was also little interest in my patches about those issues...

I have for a while been toying with taking the image format parsers  
(all in pure python) from the PIL and hooking that up to numpy for  
actually unpacking the bits from the file. (Right now, the PIL uses  
some custom and occasionally questionable C code to do this.) I've  
made no progress, but I think it would be possible to do so with not  
too much fuss. Would there be any interest in something like this?

My current solution is a fork of PIL that I made, which rips out  
basically everything except image IO, and for which I fixed the 16- 
bit image problems and drastically beefed up the numpy compatibility.  
I'd be happy to send this to anyone who desires, or if there was a  
specific clamor, make it a scikit or something. Is there any interest  
regarding that either?

Zach Pincus




On Oct 8, 2007, at 6:46 PM, Stefan van der Walt wrote:

> On Mon, Oct 08, 2007 at 02:21:39PM +0000, Sebastian wrote:
>> Robert Kern <robert.kern <at> gmail.com> writes:
>>> Exactly what version of scipy are you talking about? The one I  
>>> have from a
>>> recent SVN checkout works fine. It was modified to its current  
>>> form on
>>> 2007-08-28. It might also be that this code relies on behavior of  
>>> recent
>>> releases of PIL. I am using PIL 1.1.6b2. What are you using?
>>>
>>
>> Hello,
>> I used the PIL 1.1.5. After installing the PIL 1.1.6 the problem  
>> was solved.
>> Thanks for your kind help.
>
> PIL 1.1.6 is still broken to some extent.  I sent a patch to the Image
> SIG:
>
> http://mail.python.org/pipermail/image-sig/2007-August/004570.html
>
> Unfortunately, there was no reaction.
>
> Cheers
> Stéfan
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user



More information about the SciPy-user mailing list