Re: [Image-SIG] problem with numpy.asarray and PIL

2009-08-07 Thread Guy K. Kloss
On Fri, 07 Aug 2009 01:39:14 Fredrik Lundh wrote: > Sure, but it would still be interesting to know if the 1.1.7 changes > actually solves this specific problem, so we know if/how it can be > worked around or monkey patched. You're 100% right with that. Guy (Hoping that 1.1.7 will find its way in

Re: [Image-SIG] problem with numpy.asarray and PIL

2009-08-06 Thread Sebastian Haase
>>> import Image >>> Image.VERSION '1.1.6' >>> N.__version__ '1.3.0' >>> im=Image.open('Desktop/chart_bl.tif') >>> im2= im.convert('L') >>> a = N.asarray(im2) >>> a.shape (18710, 13228) >>> a.dtype uint8 >>> a.sum() 33087362820 >>> a = N.asarray(im) >>> a.shape (18710, 13228) >>> a.dtype bool >>> a

Re: [Image-SIG] problem with numpy.asarray and PIL

2009-08-06 Thread Fredrik Lundh
On Wed, Aug 5, 2009 at 9:52 PM, Guy K. Kloss wrote: > On Wed, 05 Aug 2009 22:57:42 you wrote: >> Note that there's been some changes to the numpy interface in 1.1.7, >> which was recently tagged for release, even though I haven't gotten >> around to cut the tarballs just yet: >> >>    http://hg.eff

Re: [Image-SIG] problem with numpy.asarray and PIL

2009-08-06 Thread Gary Capell
2009/8/4 Guy K. Kloss > Maybe it's something really in the way that PIL aligns its image data that > then is dumped into a NumPy array by plugging a header structure on top. That was my theory, but I worked around it rather than diving in with gdb to find out for sure. _

Re: [Image-SIG] problem with numpy.asarray and PIL

2009-08-06 Thread Gary Capell
2009/8/4 Guy K. Kloss > On Mon, 27 Jul 2009 19:08:16 Gary Capell wrote: > > I get this problem (with python2.6, PIL 1.1.6, numpy 1.3.0 ) > > > > >>> from PIL import Image > > >>> import numpy > > >>> i = Image.open('chart_bl.tif') > > >>> a = numpy.asarray(i) > > >>> o.size, a.shape > > ((13228,

Re: [Image-SIG] problem with numpy.asarray and PIL

2009-08-05 Thread Guy K. Kloss
On Wed, 05 Aug 2009 22:57:42 you wrote: > Note that there's been some changes to the numpy interface in 1.1.7, > which was recently tagged for release, even though I haven't gotten > around to cut the tarballs just yet: > >http://hg.effbot.org/pil-2009-raclette/src/pil-117/ One of the biggest

Re: [Image-SIG] problem with numpy.asarray and PIL

2009-08-05 Thread Fredrik Lundh
Note that there's been some changes to the numpy interface in 1.1.7, which was recently tagged for release, even though I haven't gotten around to cut the tarballs just yet: http://hg.effbot.org/pil-2009-raclette/src/pil-117/ On Tue, Aug 4, 2009 at 10:09 PM, Guy K. Kloss wrote: > Fredrik, >

Re: [Image-SIG] problem with numpy.asarray and PIL

2009-08-05 Thread Sebastian Haase
Hi, I would like to take a look at the offending image, if you could make available somewhere for download - somthing like www.drop.io - Sebastian Haase On Tue, Aug 4, 2009 at 10:09 PM, Guy K. Kloss wrote: > Fredrik, > > On Tue, 04 Aug 2009 21:28:35 Fredrik Lundh wrote: >> Note that PIL has its

Re: [Image-SIG] problem with numpy.asarray and PIL

2009-08-04 Thread Guy K. Kloss
Fredrik, On Tue, 04 Aug 2009 21:28:35 Fredrik Lundh wrote: > Note that PIL has its own histogram method (for a monochrome image, > the counts will end up in slot 0 and 255). that may be true. But many people (including myself) have got needs for more in-depth analyses using the functions that e.

Re: [Image-SIG] problem with numpy.asarray and PIL

2009-08-04 Thread Fredrik Lundh
On Mon, Jul 27, 2009 at 9:08 AM, Gary Capell wrote: > I get this problem (with python2.6, PIL 1.1.6, numpy 1.3.0 ) > from PIL import Image import numpy i = Image.open('chart_bl.tif') a = numpy.asarray(i) o.size, a.shape > ((13228, 18710), (18710, 13228)) o.size, a.shap

Re: [Image-SIG] problem with numpy.asarray and PIL

2009-08-03 Thread Guy K. Kloss
On Tue, 04 Aug 2009 17:07:18 you wrote: > I'm OK with the operation not making much sense, I'm not OK with python > dying with a segmentation fault. > > For what it's worth, I also get a segfault with a.sum(): Hmmm, interesting. I've just given it a try with pure numpy boolean arrays. And that wo

Re: [Image-SIG] problem with numpy.asarray and PIL

2009-08-03 Thread Guy K. Kloss
On Mon, 27 Jul 2009 19:08:16 Gary Capell wrote: > I get this problem (with python2.6, PIL 1.1.6, numpy 1.3.0 ) > > >>> from PIL import Image > >>> import numpy > >>> i = Image.open('chart_bl.tif') > >>> a = numpy.asarray(i) > >>> o.size, a.shape > ((13228, 18710), (18710, 13228)) > >>> o.size, a.sh