Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Difference between color image and gray image
Difference between color image and gray image
Color image, each pixel is usually represented by three components: red (R), green (G) and blue (B), and the components are between (0,255). RGB images, like index images, can be used to represent color images. Like the index image, it represents the color of each pixel by the combination of red (R), green (G) and blue (B) respectively. However, unlike an index image, the color value of each pixel of an RGB image (represented by three primary colors of RGB) is directly stored in the image matrix. Because the color of each pixel needs to be represented by three components of R, G and B, M and N represent the number of rows and columns of the image respectively, and the three two-dimensional matrices of M×N represent the three color components of each pixel respectively. The data type of RGB images is generally 8-bit unsigned shaping, which is usually used to represent and store true color images, and of course, gray images can also be stored.

Gray image is an image with only one sampling color per pixel, which is usually displayed as gray from the darkest black to the brightest white, although in theory, this sampling can be different colors of any color, even different colors with different brightness. Gray images are different from black and white images. In the field of computer images, there are only two colors of black and white images. However, in grayscale images, there are many color depth levels between black and white. Gray-scale images are usually obtained by measuring the brightness of each pixel in a single electromagnetic spectrum (such as visible light). Gray-scale images used for display are usually stored in a nonlinear scale of 8 bits per sampling pixel, so there can be 256 gray scales (if 16 bits are used, there are 65536 levels).