Basic principles of showing a picture in computers

                               Basic Principles of Showing a Picture in Computers

电子科技大学(UESTC) 格拉斯哥学院 2017级 王子初

To show a picture on the screen, matrix is an important tool and is helpful. To explain this briefly, an example is that computers make use of an m by n matrix to show a picture with m x n pixel. Before everything begins, we need to be aware of some concepts we will use to realize this.

1.Gray level. This is often used in a black and white picture, where number of gray level is always between 0 and 255(which occupies 1 byte usually in computer). The larger gray level is, the brighter the picture is.

2.Three-primary colors. This can be used in a picture with different color. Three-primary colors are red, blue and yellow. Similar to the gray level, we also utilize a number to show the brightness of each color, from 0 to 255.

3.Pixel. Pixel is the basic unit of a digital picture. It is the smallest unit of a picture, which means it can’t be divided.

Actually, to show the connection between a digital picture and mathematics, we can imagine the picture as a special matrix. Each pixel in the picture represents an element in the matrix. Each pixel has its own position, and the color shown by each pixel can be translated into a certain number or vector.

Firstly, we take a black-and-white picture as an example. We use number from 0 to 255 to show the gray level of each pixel and put them into the matrix corresponding to the position of the pixel. Then, a matrix describing the picture is let out, and this process is called quantification. Below is a picture to show this process.

Basic principles of showing a picture in computers

The number in each box is the corresponding gray level. And if we consider each box as a pixel, we can get a matrix:
Basic principles of showing a picture in computers

For a colorful picture, we can also translate it into a matrix. However, different from the black-and-white picture whose corresponding matrix has a scalar in each element, the elements in the new matrix are three-dimensional vectors, in which three scalars correspond to the brightness of three primary color respectively. This is the quantification of a colorful picture.

There’s also another way to quantify a colorful picture. That is , to divide the former matrix into 3 matrix with only one scalar for each element. The three matrix correspond to the distribution of brightness of red, blue and yellow respectively.

These are the basic principles to organize a picture in computers. They are significant because they are the basis for any further process to the pictures. To explain this further, if we want to finish the graphic processing, we should firstly quantify the picture and then operate the matrix in a certain way which can meet our needs. For example, if we want to sharpen a graph, a certain algorithm is required to find the edge of the object and add a new matrix to the primary one to highlight the edge. However, this is not the topic I want to discuss right now.

Anyway, the brief principles of showing a picture in computers have been shown above. Although it’s easy, we should understand this clearly if we are hoping for a further study about graphic processing.