简体   繁体   English

24位图像中有多少种颜色组合

[英]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. 如今,您可以购买的每台PC都有硬件,可以渲染至少1670万种颜色的图像。 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. 当然,24位显示器使用24位或每像素3个字节来显示颜色信息。 This gives 1 byte, or 256 distinct values each, for red, green, and blue. 对于红色,绿色和蓝色,这给出了1个字节或256个不同的值。 This is generally called true color, because 256^3 (16.7 million) 这通常称为真彩色,因为256 ^ 3(1670万)

He says 1 byte is equal to 256 distinct values. 他说1个字节等于256个不同的值。 1 byte = 8 bits. 1字节= 8位。 8^2 bits = 64 combinations of colors right ?? 8 ^ 2位= 64种颜色组合对吗? It's not adding up right to me. 这对我来说并不合适。 I know it might be something simple to understand, but I don't understand. 我知道这可能是一件容易理解的事情,但我不明白。

The combinations of 8 bits is not 8 2 (64) but 2 8 (256). 8位的组合不是8 2 (64)而是2 8 (256)。 This is because each of the 8 bits can have 2 distinct values. 这是因为8位中的每一位可以具有2个不同的值。 For 1 bit that would give you 2 (2 1 ) possibilities, for 2 bits 2*2 (2 2 ), for 3 bits 2*2*2 (2 3 )... etc. 3 bytes = 24 bits => 2 24 = 16.7M possible combinations. 对于1位,将给出2(2 1 )种可能性,对于2位2 * 2(2 2 ),对于3位2 * 2 * 2(2 3 )......等等.3字节= 24位=> 2 24 = 16.7M可能的组合。

1 byte = 8 bits = 2^8 = 256 combinations :)

24 bit combinations = 2^24 = Three 8 bit colors = 256^3 = 16777216 ~= 16.7 million color combinations

如果您有24位颜色信息,您可以显示2 ^ 24种颜色= 1670万!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM