I know little about computer graphic. My problem is that I need the pixel value of pixels in a colorized image (.BMP format), and use the value for some data analysis. I have the grayscale version of the same image, and I see it is a 2D matrix. So I can specify the coordinates of a pixel and get its pixel value.
But when I come to colorized version of the image, it is a 3D matrix that, as you said, combined by red, green and blue. I think there could be a way to extract the pixel value, not in three individual channels but a single metric?