Shenzhen Kai Mo Rui Electronic Technology Co. LTDShenzhen Kai Mo Rui Electronic Technology Co. LTD

News

Fundamentals of Image Processing - Image Classification

Source:Shenzhen Kai Mo Rui Electronic Technology Co. LTD2026-04-14

Fundamentals of Image Processing – Image Classification

(1) Binary ImageContains only black and white colors. Black is represented by 0 and white by 1. Binary images are suitable for images composed of black and white without grayscale shading.

(2) Grayscale ImageThe value range of matrix elements in a grayscale image is usually [0, 255]. Therefore, its data type is generally 8-bit unsigned integer (uint8), which is the commonly referred 256-level grayscale image. "0" represents pure black, "255" represents pure white, and the intermediate numbers from small to large represent the transitional shades from black to white.Grayscale images only have grayscale tones without colors. The so-called black-and-white photographs we usually refer to actually contain all grayscale tones between black and white.

(3) Indexed Color ImageThe red, green, and blue component values in the color palette are not all equal; pixel values are the index addresses of the image color palette.

In this mode, colors are predefined, and the set of available colors is very limited. An indexed color image can display a maximum of 256 colors.

Indexed color is also commonly called mapped color. An indexed color image is defined in the image file. When the file is opened, the index values corresponding to the specific colors of the image are read into the program, and the final colors are retrieved according to the index values.

The file structure of an indexed image is relatively complex. In addition to the two-dimensional matrix storing the image, it also includes a two-dimensional array called the color index matrix MAP. The size of MAP is determined by the value range of the matrix elements storing the image. For example, if the value range of matrix elements is [0, 255], the size of the MAP matrix is 256×3, expressed as MAP = [RGB].The three elements in each row of MAP specify the monochrome values of red, green, and blue for the corresponding color of that row respectively. Each row in MAP corresponds to one grayscale value of a pixel in the image matrix.

The data type of an indexed image is generally 8-bit unsigned integer (uint8), and the size of the corresponding index matrix MAP is 256×3. Therefore, ordinary indexed images can only display 256 colors simultaneously, but the color types can be adjusted by changing the index matrix.

Indexed images are generally used to store images with simple color requirements. For example, most wallpapers with simple color composition in Windows are stored as indexed images. For images with complex colors, RGB true-color images are required.

(4) True-Color RGB ImageLike indexed images, RGB images represent the color of each pixel through the combination of the three primary colors: red (R), green (G), and blue (B).

However, unlike indexed images, the color value of each pixel in an RGB image (represented by the three RGB primary colors) is directly stored in the image matrix. Since the color of each pixel must be represented by three components R, G, and B, each component occupies 1 byte, representing different brightness values from 0 to 255. The combination of these three bytes can produce more than 16.7 million different colors.

M and N represent the number of rows and columns of the image respectively. Three M×N two-dimensional matrices represent the R, G, and B color components of each pixel respectively.The data type of RGB images is generally 8-bit unsigned integer (uint8). They are usually used to represent and store true-color images, and can certainly store grayscale images as well.

RGB images are stored row by row and column by column, with each column containing three channels.Note: The channel order is BGR, not RGB.

新闻22.png

Related News

Professional Engineer

24-hour online serviceSubmit requirements and quickly customize solutions for you

+8613798538021