Selecting raster cells by multiband values in QGIS
Using a sample of RGB raster of 4 cells:
- Upper left cell: Light grey (150, 150, 150)
- Lower left cell: Dark grey (100, 100, 100)
- Upper right cell: Red (250, 0, 0)
- Lower right cell: Blue (0, 0, 250)
Equation to the Raster calculator to create the filter:
( "Band@1" - "Band@2" = 0) * ( "Band@2" - "Band@3" = 0 ) = 1
(This also works without = 1
.)
The filter returns 1 for R,G,B band (or @1, @2, @3 as in Raster calculator) have the same value.