Computer Graphics (iii) _ Elements of attributes _2_ color and grayscale

Source: Internet
Author: User

Color and grayscale

Color is a basic property of all entities. Users can choose from a variety of colors, depending on the capabilities and design goals of a particular system. The color can be specified either from the menu or from the ruler displayed. For video monitors, these color codes are converted to control the intensity level of the electron beam. In the color plotter, the color code can be used to control the ink-jet volume or pen selection.

RGB color Component

In color grating systems, the number of colors available depends on the storage capacity provided in the frame cache. Color information can be stored in the frame cache in two ways: either store the RGB encoding directly in the frame cache, or save the color code in a separate table and store the index of the color table entry in the pixel location. When using a direct storage scheme, when the application specifies a specific color encoding, the color information is placed in the frame cache that will be the pixel location of the output entity that is to be displayed with that color. Table 4.1 shows the limited color available for this scenario using 3 bits per pixel. The 3-bit value of each position is used to control the intensity level of the corresponding electron gun of the RGB monitor (at this point, on or off).the leftmost one controls the red gun, the middle position controls the green gun, and the rightmost one controls the blue gun. In frame slowadd some bits in the save to increase the number of colors that can be selected. With 6 bits per pixel, each gun can be controlled by 2 bits. This can make threeeach of the color guns is controlled by 4 different intensities, and each screen pixel has 64 colors to choose from. As the number of colors provided increases, the capacity requirements for the frame cache also increase. A full color (24 bits per pixel) RGB system with a resolution of 1024 pixels requires 3 MB of frame cache capacity.
color tables are an alternative to extending the color capabilities of users without large frame caching。 This approach was once a very important consideration. But today's hardware costs have fallen sharply, and even the ability to expand color in low-end personal computer systems has been quite common. Therefore, most of our examples will simply assume that the RGB encoding is stored directly in the frame cache.


Color Table
Figure 4.1 shows a possible scenario for storing color values in a color lookup table or color map. Sometimes a color table is also called a video lookup table. The values in the frame cache are then used as indexes that point to the color table. In this example, each pixel can refer to any one of the 256 table locations, and each table item uses 24 bits to specify an RGB color. The hexadecimal color code 0x0821 displays the green-blue blend color at the pixel position (x, y). The system using this special lookup table allows the user to display at the same time any of 256 colors from nearly 17oo colors. Compared to full color systems, this scheme reduces the amount of color that can be displayed simultaneously, but also reduces the frame cache capacity to as long as 1MB. Multiple color tables are sometimes required to handle special drawing applications such as anti-aliasing and multiple output devices.
The color table is used in many applications, providing a "reasonable" number of colors that can be displayed simultaneously without requiring a large-volume frame cache. In most applications, 256 or 512 colors are sufficient to display a picture. In addition, the table item content can be modified at any time, making it easy for users to experiment with different color combinations in designs, scenes, and charts without changing the settings of attributes in the graphical data structure. When the value of an item in the color table changes, all pixels that use that color index are changed to the new color. If you do not use a color table, you can modify the color of some pixels only by depositing a new color in the frame cache location. Similarly, data visualization applications can put certain physical quantities (such as the value of energy) into the frame cache and use a lookup table to experiment with various color combinations without altering the pixel values. In visualization and image processing applications, the color table is a handy tool for setting thresholds and displaying the same color when the pixel value falls below a specified threshold.

Grayscale
Since the computer graphics system has color capabilities, we can use the RGB color function in the application to set the gray degree or grayscale (gray scale). When you specify the same amount of red, green, and blue in the RGB function, the result is some degree of gray. A value near 0 produces a dark gray, and a value close to 1 produces a bright gray. Applications for grayscale display methods include enhancing black and white photos and producing visualizations.

Other color parameters

In addition to the RGB color description, computer graphics applications also use some other three-component color descriptions. For example, the printer output color is described by three components of cyan, magenta, and yellow , while the color interface sometimes uses light and dark to select colors. Color and light are a complex phenomenon in the general sense, and many terms and concepts are presented in optics, irradiance and psychology to describe various aspects of light sources and lighting effects. Physically, a color can be described as electromagnetic radiation with a certain frequency range and energy distribution, but it also involves our sense of color. Therefore, we use the physical term strength (intensity) to quantify the light radiation in a given direction in a time period, and to describe the characteristics of the sensory glow using the luminance of the psychological terminology.

Computer Graphics (iii) _ Elements of attributes _2_ color and grayscale

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.