4.3. Color image to grayscale image

The previous image is an RGB image, which is a colored image. The brightness levels of the red (R), green (G), and blue (B) components are each represented as a number from decimal 0 to 255. Therefore, the RGB image has to be converted to black-and-white image forthe ease of processing. The lightness of the gray color is directly proportional to the number representing the brightness levels of the primary colors. Black is represented by value for each R, G, and B is 0. Meanwhile, white is represented by value of each R, G, and B is 1. The converted grayscale image is shown in Figure 6.
