views:

59

answers:

2

Possible Duplicate:
how many color combinations in a 24 bit image

I am reading a book and I am not sure if its a mistake or I am misunderstanding the quote. It reads...

Nowadays every PC you can buy has hardware that can render images with at least 16.7 million individual colors. Rather than have an array with thousands of color entries, the images instead contain explicit color values for each pixel. A 24-bit display, of course, uses 24 bits, or 3 bytes per pixel, for color information. This gives 1 byte, or 256 distinct values each, for red, green, and blue. This is generally called true color, because 256^3 (16.7 million)

He says 1 byte is equal to 256 distinct values. 1 byte = 8 bits. 8^2 bits = 64 distinct colors right ?? It's not adding up right to me. I know it might be something simple to understand, but I don't understand.

+6  A: 

Each of the red, green, and blue bands has 2^8 (not 8^2!) possible values, that is, 256 distinct possibilities. IOW, with one byte you can "count" from 0 to 255.

So your problem is just that you're confusing the base and exponent involved in the raise-to-power operation in question.

Alex Martelli
that makes sense. thanks
numerical25
+1  A: 

Its not 8^2 , but its 2^8 = 256.

Jujjuru