Loading...
Implement a function to convert a list of RGB pixels to their corresponding grayscale values. This process involves transforming color spaces, where each pixel's luminance is calculated based on its red, green, and blue components.
The human visual system is more sensitive to certain colors, which is reflected in the weighted sum used for conversion. The sensitivity to green is highest, followed by red, and then blue, which is represented by the coefficients in the conversion formula.
To perform the conversion, follow these steps:
This technique is widely used in image processing applications.
pixels = [[255, 0, 0], [0, 255, 0], [0, 0, 255]]
[76, 150, 29]