Get all the pixel which have a specific color (in RGB mode)

Good afternoon,

I’d like to know if it’s possible to create a mask with SNAP which contains all the pixels of an RGB image with a specific value [ex: white = (255,255,255) for example].

Maybe it’s not possible to do that with the current tools in the software.

Thank you.

Hi @arossCLS,

I think by defining the valid pixel expression you should be able but not directly on the RGB composition but on each individual band. Be aware that on SNAP you get reflectance values that do not correspond directly to the typical 0-255 range.

If this does not work, you can use band math with an expression like this. You can defined it for each band (RGB) and then create your RGB composition

if B2>0.2 then B2 else 0


if B2>0.2 then B2 else NaN


1 Like