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

Fredrik Lundh fredrik at pythonware.com
Tue Aug 4 11:28:35 CEST 2009


On Mon, Jul 27, 2009 at 9:08 AM, Gary Capell<gary.capell at gmail.com> 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.shape, a.dtype
> ((13228, 18710), (18710, 13228), dtype('bool'))
>>>> numpy.histogram(a)
> Segmentation fault

Note that PIL has its own histogram method (for a monochrome image,
the counts will end up in slot 0 and 255).

</F>


More information about the Image-SIG mailing list