Re: 16-bit colour representation

2007-07-25 Thread Diez B. Roggisch
>> v = 0x0bcd >> b = v & 0xf >> v >>= 4 >> g = v & 0xf >> v >>= 4 >> r = v & 0xf >> print r, g, b >> >> > Alternatively, using 5-bit colors you would use > > b = v & 0x1f > g = (v >> 5) & 0x1f > r = (v >> 10) & 0x1f Darn. I knew I missed _something_... Diez -- http://mail.python.org/mailman/l

Re: 16-bit colour representation

2007-07-25 Thread Steve Holden
Diez B. Roggisch wrote: > beertje wrote: > >> This has me a bit stumped... >> >> I'm trying to extract pictures from a file. So far I'm successfully >> retrieved the header and what I think is the colour for each pixel. >> Here's the description: >> >> """ >> 3) The picture data format: >> The col

Re: 16-bit colour representation

2007-07-25 Thread Steve Holden
Diez B. Roggisch wrote: > beertje wrote: > >> This has me a bit stumped... >> >> I'm trying to extract pictures from a file. So far I'm successfully >> retrieved the header and what I think is the colour for each pixel. >> Here's the description: >> >> """ >> 3) The picture data format: >> The col

Re: 16-bit colour representation

2007-07-25 Thread Diez B. Roggisch
beertje wrote: > This has me a bit stumped... > > I'm trying to extract pictures from a file. So far I'm successfully > retrieved the header and what I think is the colour for each pixel. > Here's the description: > > """ > 3) The picture data format: > The color information is 15 bit data store

Re: 16-bit colour representation

2007-07-25 Thread John Machin
On Jul 25, 9:53 pm, beertje <[EMAIL PROTECTED]> wrote: > This has me a bit stumped... > > I'm trying to extract pictures from a file. So far I'm successfully > retrieved the header and what I think is the colour for each pixel. > Here's the description: > > """ > 3) The picture data format: > The c

16-bit colour representation

2007-07-25 Thread beertje
This has me a bit stumped... I'm trying to extract pictures from a file. So far I'm successfully retrieved the header and what I think is the colour for each pixel. Here's the description: """ 3) The picture data format: The color information is 15 bit data stored in 16 bit. This means the most s