[Numpy-discussion] reading 10 bit raw data into an array

Danny Chan chan_dhf at yahoo.de
Mon Jul 30 10:01:46 EDT 2007

Hi all!
I'm trying to read a data file that contains a raw image file. Every pixel is assigned a value from 0 to 1023, and all pixels are stored from top left to bottom right pixel in binary format in this file. I know the width and the height of the image, so all that would be required is to read 10 bits at a time and store it these as an integer. I played around with the fromstring and fromfile function, and I read the documentation for dtype objects, but I'm still confused. It seems simple enough to read data in a format with a standard bitwidth, but how can I read data in a non-standard format. Can anyone help?

Greets, Danny

 Alles was der Gesundheit und Entspannung dient.BE A BETTER MEDIZINMANN!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20070730/494814ca/attachment.html>

More information about the NumPy-Discussion mailing list