gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 19:50:21 26 4
gpt4 key购买 nike

我正在读一本书,但我不确定这是一个错误还是我误解了引文。上面写着……

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)

他说 1 个字节等于 256 个不同的值。 1 字节 = 8 位。 8^2 位 = 64 种颜色组合对吗??这不适合我。我知道这可能很容易理解,但我不明白。

最佳答案

8位的组合不是8<​​sup>2(64)而是28(256)。这是因为 8 位中的每一位都可以有 2 个不同的值。 1 位会给你 2 (21) 种可能性,2 位 2*2 (22),3 位 2*2*2 (2< sup>3)...等 3 字节 = 24 位 => 224 = 16.7M 可能的组合。

关于c++ - 24 位图像中有多少种颜色组合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2892303/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com