Convert an RGB image into greyscale using SNAP

Good Morning,

I would like to know if it’s possible to convert a colored image into a greyscaled image using SNAP ?
The issue is that I don’t know how to apply a band operator to a RGB image because I can’t see it in the list of products…
Maybe I can do it in this way if it’s work.

Regards,
Allan

What about just averaging the three bands in bandmaths?
= (R + G + B)/3
https://www.tutorialspoint.com/dip/grayscale_to_rgb_conversion.htm

Or use some kind of weighted average. MATLAB uses this equation:
= 0.2989 * R + 0.5870 * G + 0.1140 * B
https://www.mathworks.com/help/matlab/ref/rgb2gray.html

1 Like

You can even load jpeg or png files into SNAP. They are split into Red, Green, Blue and alpha. Also a default grayscale image is provided.


For the gray image the second equation, suggested by @snasonova, is used : 0.3 * red + 0.59 * green + 0.11 * blue
How to convert this into a single grayscale image is up to you and depends on your use case.

1 Like