Black and white images, grayscale images, and color images

Source: Internet
Author: User

A single point in an image is called a pixel. Each pixel has a value called a pixel value, which indicates the intensity of a specific color.

For a black-and-white image, the color of each pixel is represented by a binary value of 1. Then, the color is only "1" and "0. That is to say, either black or white.

For Grayscale Images, if they are not expressed by means of merging, they can be expressed as (0), (123), (255 ).

If it is expressed by color synthesis, that is, one of its pixel values is usually represented by three components: R, G, and B. Note that RGB is used to represent the color of a pixel. Note that
The RGB components must be equal, otherwise they will be colored. For example, if (123,123,123, 0) is black, (255,255,255) is gray, and () is white.


For a color chart, a pixel value is represented by three components: R, G, and B, but the RGB values must be unequal, for example (, 26, 93 ).

If the limit on R is either 255 or 0, you can infer the simplest color table (8 colors ):

(Equivalent to two digits (0, 1) to represent a color component in RGB)

If there is no limit, there may be 256*256*256 colors.

PS1: If a color is known to be (169,), how do you know its color? You can find the color picker in the Photoshop Color panel. The RGB values of common colors are as follows:

Imagine there are three lights in red, green, and blue.

When the three lights are combined, the light is white. If the brightness of the three lights is halved, the light is gray. If the three lights are switched off, the light is dark.

White (255,255,255) Gray (127,127,127) Black (, 0)

Turn off the green light and the blue light, only the red light, then only one red; only the green light or the blue light will only see the green or blue.

Red (0,255, 0) Green (255, 0) blue)

Turn off one of the lights and use the light of the other two lights to overlay them. Then, blue + Green = green, red + Blue = foreign red, red + Green = yellow.

Cyan (0,255,255) Magenta (255, 255,255) Yellow (, 0)

Other colors can be determined based on the RGB ratio of these colors.

Orange (255,127, 0) Purple (255, 0,225,128) pink green)

Lake blue (0,128,255) grass green (128,255, 0) rose red (128)


Note: in our discussion, we use 8 bits to represent a color component (such as red) in RGB ). Therefore, each color component is limited to 0. The value of 2 is 256 for 8 times.
If 8 bits are used to represent a color component in RGB, the number of bits in a pixel is 3*8 = 24 bits. It is also called 24-digit real color.



Note: The color is represented by RGB, but this is not the only method. It is represented by HSB, which is more in line with the color process in the brain.

Reference: http://dbis.nankai.edu.cn/multimedia/color/8ddf1a389ef5b1f2b311c75e.html

For more information about HSB, see http://bbs.jcwcn.com/thread-307388-1-1.html.

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.