Reading file bit by bit

Nobody nobody at nowhere.com
Mon Jun 7 06:41:45 EDT 2010


On Mon, 07 Jun 2010 02:31:08 -0700, Richard Thomas wrote:

> You're reading those bits backwards. You want to read the most
> significant bit of each byte first...

Says who?

There is no universal standard for bit-order.

Among bitmap image formats, XBM is LSB-first while BMP and PBM are
MSB-first. OpenGL reads or writes bitmap data in either order, controlled
by glPixelStorei().

Most serial communication links (e.g. RS-232, ethernet) transmit the LSB
first, although there are exceptions (e.g. I2C uses MSB-first).




More information about the Python-list mailing list