Re: [Numpy-discussion] Help with bit arrays

2016-04-29 Thread Henrique Almeida
 I agree with everything, but the unexpected are something else.

 The TIFF images have no colormap. The colormap that I'm referring to
is the GUI colormap, used by matplotlib to draw the image (imshow
parameter cmap).

 The problematic image format is the black and white 1-bit TIFF
format. It is a bit array format, all bits are packed in sequence.

 PIL passes this kind of image to numpy through the array_interface
getter, which returns an array description of shape = (256, 256), type
string "|b1" and data is a 8192 byte array (256 * 256 * 1 bit). This
description is invalid and causes numpy to load 65536 bytes from
memory, causing a buffer overflow (even though it does not crash).
This is unexpected #1.

 matplotlib.imread(), when loading a 8-bit grayscale image creates an
array of shape (256, 256). matplotlib.imread(), when loading a 1-bit
black and white image creates an array of shape (256, 256, 4) by first
converting the black and white image to RGBA. This difference between
grayscale and black and white is unexpected #2.


2016-04-29 14:22 GMT-03:00 Benjamin Root :
> What behavior is unexpected?  For the (256, 256) images, matplotlib applies
> its default colormap to the grayscale (v1.5 and previous, that is jet,
> +v2.0, that will be viridis). The numpy array as loaded from PIL will never
> carry any additional information that came from the TIFF.
>
> As for PIL, it will return an RGB[A] array if there is colormap data in the
> TIFF. If there is no colormap specified in the TIFF, it'll give you a simple
> 2D array. Now, maybe you'd like it to always return an RGB[A] array, but
> without a colormap in the TIFF, it makes sense to return the data as-is.
> This makes sense for people treating the TIFF as a data format rather than a
> visualization data format.
>
> Ben Root
>
>
> On Fri, Apr 29, 2016 at 12:47 PM, Henrique Almeida 
> wrote:
>>
>>  I think in any case, the result is unexpected, PIL is loading garbage
>> from memory when loading black and white images because it sends the
>> wrong buffer size, and matplotlib correctly loads the black and white
>> image, but stores it in a 3D array.
>>
>> 2016-04-29 13:43 GMT-03:00 Henrique Almeida :
>> >  For 1 bit images, the resulting array has shape (256, 256, 4). For
>> > grayscale images, the shape is (256, 256). So the image seems to have
>> > been loaded as a color image.
>> >
>> > 2016-04-29 13:38 GMT-03:00 Benjamin Root :
>> >> What kind of array is "img"? What is its dtype and shape?
>> >>
>> >> plt.imshow() will use the default colormap for matplotlib if the given
>> >> array
>> >> is just 2D. But if it is 3D (a 2D array of RGB[A] channels), then it
>> >> will
>> >> forego the colormap and utilize that for the colors. It knows nothing
>> >> of the
>> >> colormap contained in the TIFF.
>> >>
>> >> Ben Root
>> >>
>> >>
>> >> On Fri, Apr 29, 2016 at 12:31 PM, Henrique Almeida
>> >> 
>> >> wrote:
>> >>>
>> >>>  Paul, yes, imread() worked for reading the black and white TIFF. The
>> >>> situation improved, but now, there seems to be some problem with the
>> >>> color map. Example code:
>> >>>
>> >>> #!/usr/bin/env python3
>> >>> import numpy
>> >>> from matplotlib import pyplot, cm
>> >>>
>> >>> img = pyplot.imread('oi-00.tiff')
>> >>> pyplot.imshow(img)
>> >>> pyplot.colorbar()
>> >>> pyplot.show()
>> >>>
>> >>>  The code can open both 1-bit and 8-bit images, but only with 8 bits
>> >>> the image is shown with the colormap colors. The 1 bit image is shown
>> >>> as black and white.
>> >>>
>> >>>  The questions:
>> >>>  1) Should Image.open() behave like pyplot.imread() ? Is this a bug in
>> >>> PIL
>> >>> ?
>> >>>  2) Why isn't the colormap working with black and white images ?
>> >>>
>> >>> 2016-04-29 13:06 GMT-03:00 Paul Hobson :
>> >>> > Does using pyplot.imgread work?
>> >>> >
>> >>> > On Fri, Apr 29, 2016 at 8:27 AM, Henrique Almeida
>> >>> > 
>> >>> > wrote:
>> >>> >>
>> >>> >>  Any help with this problem ?
>> >>> >>
>> >>> >> 2016-04-27 11:35 GMT-03:00 Henrique Almeida
>> >>> >> :
>> >>> >> >  Hello, what's the current status on numpy for loading bit-arrays
>> >>> >> > ?
>> >>> >> >
>> >>> >> > I'm currently unable to correctly load black and white (1-bit)
>> >>> >> > TIFF
>> >>> >> > images. Code example follows:
>> >>> >> >
>> >>> >> > from PIL import Image
>> >>> >> > import numpy
>> >>> >> > from matplotlib import pyplot
>> >>> >> >
>> >>> >> > img = Image.open('oi-00.tiff')
>> >>> >> > a = numpy.array(img)
>> >>> >> >
>> >>> >> > ^ does not work for 1-bit TIFF images
>> >>> >> >
>> >>> >> > PIL source shows that it incorrectly uses typestr == '|b1'. I
>> >>> >> > tried
>> >>> >> > to
>> >>> >> > change this to '|t1', but I get :
>> >>> >> >
>> >>> >> > TypeError: data type "|t1" not understood
>> >>> >> >
>> >>> >> > My goal is to make the above code to work 

Re: [Numpy-discussion] Help with bit arrays

2016-04-29 Thread Benjamin Root
What behavior is unexpected?  For the (256, 256) images, matplotlib applies
its default colormap to the grayscale (v1.5 and previous, that is jet,
+v2.0, that will be viridis). The numpy array as loaded from PIL will never
carry any additional information that came from the TIFF.

As for PIL, it will return an RGB[A] array if there is colormap data in the
TIFF. If there is no colormap specified in the TIFF, it'll give you a
simple 2D array. Now, maybe you'd like it to always return an RGB[A] array,
but without a colormap in the TIFF, it makes sense to return the data
as-is. This makes sense for people treating the TIFF as a data format
rather than a visualization data format.

Ben Root


On Fri, Apr 29, 2016 at 12:47 PM, Henrique Almeida 
wrote:

>  I think in any case, the result is unexpected, PIL is loading garbage
> from memory when loading black and white images because it sends the
> wrong buffer size, and matplotlib correctly loads the black and white
> image, but stores it in a 3D array.
>
> 2016-04-29 13:43 GMT-03:00 Henrique Almeida :
> >  For 1 bit images, the resulting array has shape (256, 256, 4). For
> > grayscale images, the shape is (256, 256). So the image seems to have
> > been loaded as a color image.
> >
> > 2016-04-29 13:38 GMT-03:00 Benjamin Root :
> >> What kind of array is "img"? What is its dtype and shape?
> >>
> >> plt.imshow() will use the default colormap for matplotlib if the given
> array
> >> is just 2D. But if it is 3D (a 2D array of RGB[A] channels), then it
> will
> >> forego the colormap and utilize that for the colors. It knows nothing
> of the
> >> colormap contained in the TIFF.
> >>
> >> Ben Root
> >>
> >>
> >> On Fri, Apr 29, 2016 at 12:31 PM, Henrique Almeida <
> hdante.l...@gmail.com>
> >> wrote:
> >>>
> >>>  Paul, yes, imread() worked for reading the black and white TIFF. The
> >>> situation improved, but now, there seems to be some problem with the
> >>> color map. Example code:
> >>>
> >>> #!/usr/bin/env python3
> >>> import numpy
> >>> from matplotlib import pyplot, cm
> >>>
> >>> img = pyplot.imread('oi-00.tiff')
> >>> pyplot.imshow(img)
> >>> pyplot.colorbar()
> >>> pyplot.show()
> >>>
> >>>  The code can open both 1-bit and 8-bit images, but only with 8 bits
> >>> the image is shown with the colormap colors. The 1 bit image is shown
> >>> as black and white.
> >>>
> >>>  The questions:
> >>>  1) Should Image.open() behave like pyplot.imread() ? Is this a bug in
> PIL
> >>> ?
> >>>  2) Why isn't the colormap working with black and white images ?
> >>>
> >>> 2016-04-29 13:06 GMT-03:00 Paul Hobson :
> >>> > Does using pyplot.imgread work?
> >>> >
> >>> > On Fri, Apr 29, 2016 at 8:27 AM, Henrique Almeida
> >>> > 
> >>> > wrote:
> >>> >>
> >>> >>  Any help with this problem ?
> >>> >>
> >>> >> 2016-04-27 11:35 GMT-03:00 Henrique Almeida  >:
> >>> >> >  Hello, what's the current status on numpy for loading bit-arrays
> ?
> >>> >> >
> >>> >> > I'm currently unable to correctly load black and white (1-bit)
> TIFF
> >>> >> > images. Code example follows:
> >>> >> >
> >>> >> > from PIL import Image
> >>> >> > import numpy
> >>> >> > from matplotlib import pyplot
> >>> >> >
> >>> >> > img = Image.open('oi-00.tiff')
> >>> >> > a = numpy.array(img)
> >>> >> >
> >>> >> > ^ does not work for 1-bit TIFF images
> >>> >> >
> >>> >> > PIL source shows that it incorrectly uses typestr == '|b1'. I
> tried
> >>> >> > to
> >>> >> > change this to '|t1', but I get :
> >>> >> >
> >>> >> > TypeError: data type "|t1" not understood
> >>> >> >
> >>> >> > My goal is to make the above code to work for black and white TIFF
> >>> >> > images the same way it works for grayscale images. Any help ?
> >>> >> ___
> >>> >> NumPy-Discussion mailing list
> >>> >> NumPy-Discussion@scipy.org
> >>> >> https://mail.scipy.org/mailman/listinfo/numpy-discussion
> >>> >
> >>> >
> >>> >
> >>> > ___
> >>> > NumPy-Discussion mailing list
> >>> > NumPy-Discussion@scipy.org
> >>> > https://mail.scipy.org/mailman/listinfo/numpy-discussion
> >>> >
> >>> ___
> >>> NumPy-Discussion mailing list
> >>> NumPy-Discussion@scipy.org
> >>> https://mail.scipy.org/mailman/listinfo/numpy-discussion
> >>
> >>
> >>
> >> ___
> >> NumPy-Discussion mailing list
> >> NumPy-Discussion@scipy.org
> >> https://mail.scipy.org/mailman/listinfo/numpy-discussion
> >>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Help with bit arrays

2016-04-29 Thread Henrique Almeida
 I think in any case, the result is unexpected, PIL is loading garbage
from memory when loading black and white images because it sends the
wrong buffer size, and matplotlib correctly loads the black and white
image, but stores it in a 3D array.

2016-04-29 13:43 GMT-03:00 Henrique Almeida :
>  For 1 bit images, the resulting array has shape (256, 256, 4). For
> grayscale images, the shape is (256, 256). So the image seems to have
> been loaded as a color image.
>
> 2016-04-29 13:38 GMT-03:00 Benjamin Root :
>> What kind of array is "img"? What is its dtype and shape?
>>
>> plt.imshow() will use the default colormap for matplotlib if the given array
>> is just 2D. But if it is 3D (a 2D array of RGB[A] channels), then it will
>> forego the colormap and utilize that for the colors. It knows nothing of the
>> colormap contained in the TIFF.
>>
>> Ben Root
>>
>>
>> On Fri, Apr 29, 2016 at 12:31 PM, Henrique Almeida 
>> wrote:
>>>
>>>  Paul, yes, imread() worked for reading the black and white TIFF. The
>>> situation improved, but now, there seems to be some problem with the
>>> color map. Example code:
>>>
>>> #!/usr/bin/env python3
>>> import numpy
>>> from matplotlib import pyplot, cm
>>>
>>> img = pyplot.imread('oi-00.tiff')
>>> pyplot.imshow(img)
>>> pyplot.colorbar()
>>> pyplot.show()
>>>
>>>  The code can open both 1-bit and 8-bit images, but only with 8 bits
>>> the image is shown with the colormap colors. The 1 bit image is shown
>>> as black and white.
>>>
>>>  The questions:
>>>  1) Should Image.open() behave like pyplot.imread() ? Is this a bug in PIL
>>> ?
>>>  2) Why isn't the colormap working with black and white images ?
>>>
>>> 2016-04-29 13:06 GMT-03:00 Paul Hobson :
>>> > Does using pyplot.imgread work?
>>> >
>>> > On Fri, Apr 29, 2016 at 8:27 AM, Henrique Almeida
>>> > 
>>> > wrote:
>>> >>
>>> >>  Any help with this problem ?
>>> >>
>>> >> 2016-04-27 11:35 GMT-03:00 Henrique Almeida :
>>> >> >  Hello, what's the current status on numpy for loading bit-arrays ?
>>> >> >
>>> >> > I'm currently unable to correctly load black and white (1-bit) TIFF
>>> >> > images. Code example follows:
>>> >> >
>>> >> > from PIL import Image
>>> >> > import numpy
>>> >> > from matplotlib import pyplot
>>> >> >
>>> >> > img = Image.open('oi-00.tiff')
>>> >> > a = numpy.array(img)
>>> >> >
>>> >> > ^ does not work for 1-bit TIFF images
>>> >> >
>>> >> > PIL source shows that it incorrectly uses typestr == '|b1'. I tried
>>> >> > to
>>> >> > change this to '|t1', but I get :
>>> >> >
>>> >> > TypeError: data type "|t1" not understood
>>> >> >
>>> >> > My goal is to make the above code to work for black and white TIFF
>>> >> > images the same way it works for grayscale images. Any help ?
>>> >> ___
>>> >> NumPy-Discussion mailing list
>>> >> NumPy-Discussion@scipy.org
>>> >> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>>> >
>>> >
>>> >
>>> > ___
>>> > NumPy-Discussion mailing list
>>> > NumPy-Discussion@scipy.org
>>> > https://mail.scipy.org/mailman/listinfo/numpy-discussion
>>> >
>>> ___
>>> NumPy-Discussion mailing list
>>> NumPy-Discussion@scipy.org
>>> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
>>
>>
>> ___
>> NumPy-Discussion mailing list
>> NumPy-Discussion@scipy.org
>> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Help with bit arrays

2016-04-29 Thread Henrique Almeida
 For 1 bit images, the resulting array has shape (256, 256, 4). For
grayscale images, the shape is (256, 256). So the image seems to have
been loaded as a color image.

2016-04-29 13:38 GMT-03:00 Benjamin Root :
> What kind of array is "img"? What is its dtype and shape?
>
> plt.imshow() will use the default colormap for matplotlib if the given array
> is just 2D. But if it is 3D (a 2D array of RGB[A] channels), then it will
> forego the colormap and utilize that for the colors. It knows nothing of the
> colormap contained in the TIFF.
>
> Ben Root
>
>
> On Fri, Apr 29, 2016 at 12:31 PM, Henrique Almeida 
> wrote:
>>
>>  Paul, yes, imread() worked for reading the black and white TIFF. The
>> situation improved, but now, there seems to be some problem with the
>> color map. Example code:
>>
>> #!/usr/bin/env python3
>> import numpy
>> from matplotlib import pyplot, cm
>>
>> img = pyplot.imread('oi-00.tiff')
>> pyplot.imshow(img)
>> pyplot.colorbar()
>> pyplot.show()
>>
>>  The code can open both 1-bit and 8-bit images, but only with 8 bits
>> the image is shown with the colormap colors. The 1 bit image is shown
>> as black and white.
>>
>>  The questions:
>>  1) Should Image.open() behave like pyplot.imread() ? Is this a bug in PIL
>> ?
>>  2) Why isn't the colormap working with black and white images ?
>>
>> 2016-04-29 13:06 GMT-03:00 Paul Hobson :
>> > Does using pyplot.imgread work?
>> >
>> > On Fri, Apr 29, 2016 at 8:27 AM, Henrique Almeida
>> > 
>> > wrote:
>> >>
>> >>  Any help with this problem ?
>> >>
>> >> 2016-04-27 11:35 GMT-03:00 Henrique Almeida :
>> >> >  Hello, what's the current status on numpy for loading bit-arrays ?
>> >> >
>> >> > I'm currently unable to correctly load black and white (1-bit) TIFF
>> >> > images. Code example follows:
>> >> >
>> >> > from PIL import Image
>> >> > import numpy
>> >> > from matplotlib import pyplot
>> >> >
>> >> > img = Image.open('oi-00.tiff')
>> >> > a = numpy.array(img)
>> >> >
>> >> > ^ does not work for 1-bit TIFF images
>> >> >
>> >> > PIL source shows that it incorrectly uses typestr == '|b1'. I tried
>> >> > to
>> >> > change this to '|t1', but I get :
>> >> >
>> >> > TypeError: data type "|t1" not understood
>> >> >
>> >> > My goal is to make the above code to work for black and white TIFF
>> >> > images the same way it works for grayscale images. Any help ?
>> >> ___
>> >> NumPy-Discussion mailing list
>> >> NumPy-Discussion@scipy.org
>> >> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>> >
>> >
>> >
>> > ___
>> > NumPy-Discussion mailing list
>> > NumPy-Discussion@scipy.org
>> > https://mail.scipy.org/mailman/listinfo/numpy-discussion
>> >
>> ___
>> NumPy-Discussion mailing list
>> NumPy-Discussion@scipy.org
>> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Help with bit arrays

2016-04-29 Thread Benjamin Root
What kind of array is "img"? What is its dtype and shape?

plt.imshow() will use the default colormap for matplotlib if the given
array is just 2D. But if it is 3D (a 2D array of RGB[A] channels), then it
will forego the colormap and utilize that for the colors. It knows nothing
of the colormap contained in the TIFF.

Ben Root


On Fri, Apr 29, 2016 at 12:31 PM, Henrique Almeida 
wrote:

>  Paul, yes, imread() worked for reading the black and white TIFF. The
> situation improved, but now, there seems to be some problem with the
> color map. Example code:
>
> #!/usr/bin/env python3
> import numpy
> from matplotlib import pyplot, cm
>
> img = pyplot.imread('oi-00.tiff')
> pyplot.imshow(img)
> pyplot.colorbar()
> pyplot.show()
>
>  The code can open both 1-bit and 8-bit images, but only with 8 bits
> the image is shown with the colormap colors. The 1 bit image is shown
> as black and white.
>
>  The questions:
>  1) Should Image.open() behave like pyplot.imread() ? Is this a bug in PIL
> ?
>  2) Why isn't the colormap working with black and white images ?
>
> 2016-04-29 13:06 GMT-03:00 Paul Hobson :
> > Does using pyplot.imgread work?
> >
> > On Fri, Apr 29, 2016 at 8:27 AM, Henrique Almeida  >
> > wrote:
> >>
> >>  Any help with this problem ?
> >>
> >> 2016-04-27 11:35 GMT-03:00 Henrique Almeida :
> >> >  Hello, what's the current status on numpy for loading bit-arrays ?
> >> >
> >> > I'm currently unable to correctly load black and white (1-bit) TIFF
> >> > images. Code example follows:
> >> >
> >> > from PIL import Image
> >> > import numpy
> >> > from matplotlib import pyplot
> >> >
> >> > img = Image.open('oi-00.tiff')
> >> > a = numpy.array(img)
> >> >
> >> > ^ does not work for 1-bit TIFF images
> >> >
> >> > PIL source shows that it incorrectly uses typestr == '|b1'. I tried to
> >> > change this to '|t1', but I get :
> >> >
> >> > TypeError: data type "|t1" not understood
> >> >
> >> > My goal is to make the above code to work for black and white TIFF
> >> > images the same way it works for grayscale images. Any help ?
> >> ___
> >> NumPy-Discussion mailing list
> >> NumPy-Discussion@scipy.org
> >> https://mail.scipy.org/mailman/listinfo/numpy-discussion
> >
> >
> >
> > ___
> > NumPy-Discussion mailing list
> > NumPy-Discussion@scipy.org
> > https://mail.scipy.org/mailman/listinfo/numpy-discussion
> >
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Help with bit arrays

2016-04-29 Thread Henrique Almeida
 Paul, yes, imread() worked for reading the black and white TIFF. The
situation improved, but now, there seems to be some problem with the
color map. Example code:

#!/usr/bin/env python3
import numpy
from matplotlib import pyplot, cm

img = pyplot.imread('oi-00.tiff')
pyplot.imshow(img)
pyplot.colorbar()
pyplot.show()

 The code can open both 1-bit and 8-bit images, but only with 8 bits
the image is shown with the colormap colors. The 1 bit image is shown
as black and white.

 The questions:
 1) Should Image.open() behave like pyplot.imread() ? Is this a bug in PIL ?
 2) Why isn't the colormap working with black and white images ?

2016-04-29 13:06 GMT-03:00 Paul Hobson :
> Does using pyplot.imgread work?
>
> On Fri, Apr 29, 2016 at 8:27 AM, Henrique Almeida 
> wrote:
>>
>>  Any help with this problem ?
>>
>> 2016-04-27 11:35 GMT-03:00 Henrique Almeida :
>> >  Hello, what's the current status on numpy for loading bit-arrays ?
>> >
>> > I'm currently unable to correctly load black and white (1-bit) TIFF
>> > images. Code example follows:
>> >
>> > from PIL import Image
>> > import numpy
>> > from matplotlib import pyplot
>> >
>> > img = Image.open('oi-00.tiff')
>> > a = numpy.array(img)
>> >
>> > ^ does not work for 1-bit TIFF images
>> >
>> > PIL source shows that it incorrectly uses typestr == '|b1'. I tried to
>> > change this to '|t1', but I get :
>> >
>> > TypeError: data type "|t1" not understood
>> >
>> > My goal is to make the above code to work for black and white TIFF
>> > images the same way it works for grayscale images. Any help ?
>> ___
>> NumPy-Discussion mailing list
>> NumPy-Discussion@scipy.org
>> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Help with bit arrays

2016-04-29 Thread Paul Hobson
Does using pyplot.imgread work?

On Fri, Apr 29, 2016 at 8:27 AM, Henrique Almeida 
wrote:

>  Any help with this problem ?
>
> 2016-04-27 11:35 GMT-03:00 Henrique Almeida :
> >  Hello, what's the current status on numpy for loading bit-arrays ?
> >
> > I'm currently unable to correctly load black and white (1-bit) TIFF
> > images. Code example follows:
> >
> > from PIL import Image
> > import numpy
> > from matplotlib import pyplot
> >
> > img = Image.open('oi-00.tiff')
> > a = numpy.array(img)
> >
> > ^ does not work for 1-bit TIFF images
> >
> > PIL source shows that it incorrectly uses typestr == '|b1'. I tried to
> > change this to '|t1', but I get :
> >
> > TypeError: data type "|t1" not understood
> >
> > My goal is to make the above code to work for black and white TIFF
> > images the same way it works for grayscale images. Any help ?
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Help with bit arrays

2016-04-29 Thread Henrique Almeida
 Any help with this problem ?

2016-04-27 11:35 GMT-03:00 Henrique Almeida :
>  Hello, what's the current status on numpy for loading bit-arrays ?
>
> I'm currently unable to correctly load black and white (1-bit) TIFF
> images. Code example follows:
>
> from PIL import Image
> import numpy
> from matplotlib import pyplot
>
> img = Image.open('oi-00.tiff')
> a = numpy.array(img)
>
> ^ does not work for 1-bit TIFF images
>
> PIL source shows that it incorrectly uses typestr == '|b1'. I tried to
> change this to '|t1', but I get :
>
> TypeError: data type "|t1" not understood
>
> My goal is to make the above code to work for black and white TIFF
> images the same way it works for grayscale images. Any help ?
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] ANN: SciPy (Scientific Python) 2016 Conference Call for Talk / Tutorial Proposals Open Until 3/25

2016-04-29 Thread Courtenay Godshall (Enthought)
**SciPy 2016 Conference (Scientific Computing with Python) Announcement**

 

*Call for Proposals: Submit Your Tutorial and Talk Ideas by March 25, 2015
at http://scipy2016.scipy.org.

 

  SciPy 2016, the 15th annual Scientific
Computing with Python conference, will be held July 11-17, 2016 in Austin,
Texas. SciPy is a community dedicated to the advancement of scientific
computing through open source Python software for mathematics, science, and
engineering. The annual SciPy Conference brings together over 650
participants from industry, academia, and government to showcase their
latest projects, learn from skilled users and developers, and collaborate on
code development.

 

The full program will consist of
  2 days of tutorials
(July 11-12),   3 days
of talks (July 13-15), and 2 days of
  developer sprints
(July 16-17). More info is available on the conference website at
  http://scipy2016.scipy.org (where you can
sign up for the mailing list); or follow 
@scipyconf on Twitter.  

 

We hope you'll join us - early bird registration is open until May 22, 2016
at 
http://scipy2016.scipy.org/ehome/146062/332936/?&;

 

We encourage you to submit tutorial or talk proposals in the categories
below; please also share with others who you'd like to see participate!
Submit via the conference website: 
http://scipy2016.scipy.org.

 


-

*SUBMIT A SCIPY 2016 TUTORIAL PROPOSAL - DUE MARCH 21, 2016*


-

Details and submission here:

http://scipy2016.scipy.org/ehome/146062/332967/?&;

 

These sessions provide extremely affordable access to expert training, and
consistently receive fantastic feedback from participants. We're looking for
submissions on topics from introductory to advanced - we'll have attendees
across the gamut looking to learn. Whether you are a major contributor to a
scientific Python library or an expert-level user, this is a great
opportunityto share your knowledge and stipends are available.

 


-

**SUBMIT A SCIPY 2016 TALK / POSTER PROPOSAL - DUE MARCH 25, 2016*


-

Details and submission here:

http://scipy2016.scipy.org/ehome/146062/332968/?&;

 

SciPy 2016 will include 3 major topic tracks and 8 mini-symposia tracks.

 

Major topic tracks include:

- Scientific Computing in Python

- Python in Data Science (Big data and not so big data)

- High Performance Computing


Mini-symposia will include the applications of Python in:


- Earth and Space Science

- Engineering

- Medicine and Biology

- Social Sciences

- Special Purpose Databases

- Case Studies in Industry

- Education

- Reproducibility

 

If you have any questions or comments, feel free to contact us at:
scipy-organiz...@scipy.org

---

**SCIPY 2016 REGISTRATION IS OPEN**

---

Please register early. SciPy early bird registration until May 22, 2016!
Register at   http://scipy2016.scipy.org. Plus,
enter our t-shirt design contest to win a free registration. (Send a vector
art file to sc...@enthought.com by March 31 to enter).

 

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] ANN: LAST CALL for SciPy (Scientific Python) 2016 Conference Talk / Poster Proposals - Due Friday 4/1

2016-04-29 Thread Courtenay Godshall (Enthought)
**ANN: LAST CALL for SciPy 2016 Conference Talk / Poster Proposals
(Scientific Computing with Python) - Final Deadline - Friday April 1st**

  SciPy 2016, the 15th annual Scientific
Computing with Python conference, will be held July 11-17, 2016 in Austin,
Texas. SciPy is a community dedicated to the advancement of scientific
computing through open source Python software for mathematics, science, and
engineering. The annual SciPy Conference brings together over 650
participants from industry, academia, and government to showcase their
latest projects, learn from skilled users and developers, and collaborate on
code development.

 

The full program will consist of
  2 days of tutorials
(July 11-12),   3 days
of talks (July 13-15), and 2 days of
  developer sprints
(July 16-17). More info is available on the conference website at
  http://scipy2016.scipy.org (where you can
sign up for the mailing list); or follow 
@scipyconf on Twitter.  

 


-

**SUBMIT A SCIPY 2016 TALK / POSTER PROPOSAL - DUE APRIL 1, 2016*


-

Submissions for talks and posters are welcome on our website (
 http://scipy2016.scipy.org). In your abstract,
please provide details on what Python tools are being employed, and how. The
talk and poster submission deadline is March 25th, 2016

 

SciPy 2016 will include 3 major topic tracks and 8 mini-symposia tracks.

 

Major topic tracks include:

- Scientific Computing in Python

- Python in Data Science (Big data and not so big data)

- High Performance Computing

 

Mini-symposia will include the applications of Python in:

- Earth and Space Science

- Engineering

- Medicine and Biology

- Social Sciences

- Special Purpose Databases

- Case Studies in Industry

- Education

- Reproducibility

 

If you have any questions or comments, feel free to contact us at:
scipy-organiz...@scipy.org

 

---

**SCIPY 2016 REGISTRATION IS OPEN**

---

Please register early. SciPy early bird registration until May 22, 2016.
Register at   http://scipy2016.scipy.org. Plus,
enter our t-shirt design contest to win a free registration. (Send a vector
art file to sc...@enthought.com by March 31 to enter).

 

Important dates:

April 1: Talk and Poster Proposals Due

May 11: Plotting Contest Submissions Due

Apr 22: Tutorials Announced

Apr 22: Financial Aid Submissions Due

May 4: Talk and Posters Announced

May 22: Early Bird Registration Deadline

Jul 11-12: SciPy 2016 Tutorials

Jul 13-15: SciPy 2016 General Conference

Jul 16-17: SciPy 2016 Sprints

 

We look forward to an exciting conference and hope to see you in Austin in
July!

 

The Scipy 2016 Committee

  http://scipy2016.scipy.org/

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion