Skip to main content

Hello,

I have some pixels of my GeoTiff file who have this RGB combination (255,255,255). I want to replace these pixel values by (0,0,0).

But I don't want a replacement of pixels who have just one or two values with 255, (67,255, 255) stay (67,255,255).

I have start with this :

I have separate my 3 bands (RGB) with the RasterSelector, and I have apply RasterCellValueReplacer on each band. But, I wonder how to do the replacement only if the pixel has the value 255 on each band (RGB).

Thanks a lot,

Joc

All you need is a single RasterExpressionEvaluator and a conditional statement

 

 

if (A[0]==255 && A[1]==255 && A[2]==255, 0, A[i])

 

set the A[i] as appropriate for each band.

Thank you @jdh. I have try the statement but I have a syntax problem :

 


Thank you @jdh. I have try the statement but I have a syntax problem :

 

You need to replace the i in A[i].

 

 

So for the red band it would be A[0], for the Green band it would be A[1]...