Computer Color Storage Format

Source: Internet
Author: User
Tags bmp image

Turn: http://blog.csdn.net/skyflying2012/article/details/8004078

Common colors include 8-bit, 16-bit, 24-bit, and 32-bit colors. Among them, 24-bit and above are called true colors, which are the most commonly used colors on PCs. Others are basically used in embedded systems or some industrial control fields, for details, refer to the table bit-Depth Color count.
1 2 (monochrome)
2 4 (CGA)
4 16 (bytes)
8 256 (VGA)
16 65,536 (high color, XGA)
24 16,777,216 (true color/true color, svga)
32 16,777,216 (true color + alpha channel/control transparency,-game effects)
In terms of colors 256, some of the earlier interpretations are as follows: 256 paint buckets/256 color palette, assigned to them numbers/index numbers. "To which color", the color will fill in pixels. Because the number of colors such as 16 and 256 is limited, it is easy to understand this explanation. However, the computer must undergo digital encoding. In fact, 256 colors correspond to 256 digits (Binary values ), that is, 2 ^ 2*2 ^ 3*2 ^ 3 = 2 ^ 8 = 256. In the 256-color mode, the computer does not have to process 24-bit data. In the DOS era, it was much easier to process 8-bit data than 24-bit data.

Of course, any color in the 256 color can be represented by 24bit or even 32bit or 64bit. However, the 24bit Mode means 17.7million color. The 256 color mode means 256 colors, or 256 colors in the 17.7million color of 24bit.
256 color mode: a total of 8 bits (B: 2 bits; G: 3 bits; R: 3 bits ).
High color: 16 bits (B: 5 bits, G: 6 bits, R: 5 bits) in total ).
True Color: Generally, 24bit is 8bit/channel, which is true color.
In Windows, the 32-bit R, G, and B channels each occupy a total of 24 8 bits, and the brightness channel is 8 bits, so it is 32 bits, the 24-bit channels (R, G, and B) account for a total of 18 digits, and the 6 digits of the bright channel are 24 digits.
The 24 bits in the 32-bit color are used to save the color information (r8g8b8), and the other 8 bits are used to save the Alpha information. The Alpha attribute is the transparency.
The 24-digit color can also be r5g6b5 or r5g5b5.

16-bit color blocks may be less, and 32 is better.
In terms of the number of colors, it is obvious that there are 16 power, 24 times, and 32 power differences between them. From the perspective of human eyes, the 16-bit color can basically meet the display needs, and the rough looks is similar to the 24-bit color and 32-bit color. If you study it carefully, it will be found that there will be vague separation lines in the 16-digit color gradient in a large area. In practical applications, the most commonly used is a 24-digit color, such as a string that represents the color "# 80ff2e" on a webpage or elsewhere, when you use cdsee to view images, you can also see that the color depth of most images is 24 bits. As for the 32-bit color, it is added based on the 24-bit color. It is said that 8 transparent colors are added. Actually, there is not much difference with the 24-bit color, at least our eyes cannot tell.

The 32-bit color refers to the 8-bit RGB color of our image, and then the 8-bit Z-buffer is added to the 32-bit color! Among them, 24 bits are enough! The next 8 digits are displayed in 3D!

What is a 24-bit BMP image?
24 refers to the number of digits of the image color, so the image must be divided into the number of digits of the color, because since the image is stored in the form of "pixels", it is necessary to record the color value of the first "pixel, in this way, you can see the stored image when you open the image.
Record the binary digits occupied by the color value of each pixel, that is, the number of digits of the BMP image. There are different methods for recording the color value, such as using the RGB value, that is, recording the red) mix the color values of green and blue, as well as xrgb and argb.
For example, a 16-bit color value can be divided into X1, R5, G5, B5, R5, and G6, b5 bits or four bits (x, R, G, and B;
The 24-bit color value is called "true color" and has a unified color distribution: R8 bits, G8 bits, and B8 bits;
32-bit color values are generally allocated as follows: X8 bits, R8 bits, G8 bits, B8 bits, R8 bits, G8 bits, and B8 bits.
Of course there are more pictures of different color values, such as one-bit, four-bit, and eight-bit. The more digits each color value uses, the higher the precision of the color depth, the more realistic all the images are. Of course, the larger the image capacity.
In practical art, there is often a saying that "looking at the color is closer to looking at the flowers, looking at the color first and then watching the flowers, seven points of color and three points of flowers.
This shows that in any design, colors play the first Role of Information Communication in visual stimulation. Therefore, a good grasp of the basic color knowledge can be easily achieved in the web design.

In order to make the following webpage color analysis easier to understand, we will first understand the color RGB mode and HSB mode.

RGB
RGB indicates the red green and blue colors, which are also called the three primary colors. In English, they are R (red), g (green), and B (blue). On the computer, the so-called "Number" of RGB refers to the brightness, which is expressed by an integer.
In general, RGB has a brightness of 256, which is represented in numbers from 0, 1, 2 to 255. Although the maximum number is 255, 0 is also one of the numerical values, so a total of 256 levels. According to the calculation, 256-level RGB colors can combine about 16.78 million colors, that is, 256 × 256 × 256 = 16777216. It is also referred to as "16 million colors" or "10 million colors. It is also known as the 24-digit color (the power of 2 ).
For separate R, G, or B, when the value is 0, this color does not emit light; if it is 255, the color is the highest brightness. Therefore, when three colors of RGB light reach the highest brightness, the RGB value of pure white is 255,255,255. The black RGB values on the screen are 0, 0, and 0. R, which means that only Red exists and the brightness is the strongest. Neither g nor B emits light. Therefore, the redmost value is, 0, and 0. Similarly, the greenest value is 0,255, 0, and the blue value is 255. The yellow color is special, because the Red and Green are 255,255, 0

24bit is the same as 32bit. Because 24bit cannot be aligned in the video memory, not all video cards support it. On the contrary, because of alignment, 32bit is supported by most video cards (of course, the video memory must be large enough ). 32bit is actually 24bit. Generally, it is filled with 8-Bit 0 or alpha (no actual effect) on MSB ).

Computer Color Storage Format

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.