Skip to main content

Hello, Experts. I struggle to perform a simple task. Wasn't able to find a solution by googling, I'm sorry.

I want to separate a red color from a raster (RGB 255 0 0) using RasterExpressionEvaluator. The end result should just be raster containing RGB 255 0 0 color:

 

I can't seem to find the right expression. Here is the screenshot of my workbench along with the RasterExpressionEvaluator parameters:

 

 

 

Thank you very much.

If you need to keep only red color (255,0,0), the RasterExpressionEvaluator and the RasterBandNodataSetter in this workflow might help you.

 


If you need to keep only red color (255,0,0), the RasterExpressionEvaluator and the RasterBandNodataSetter in this workflow might help you.

 

Thank you for your reply.

Your workflow works just fine for a non- georeferenced TIFF (about 5Mb in size). However, if I georeference the same TIFF (it's about 500Mb in size), the output is a giant red rectangle:

 

Do you know what might cause it?

 

Thank you!


Thank you for your reply.

Your workflow works just fine for a non- georeferenced TIFF (about 5Mb in size). However, if I georeference the same TIFF (it's about 500Mb in size), the output is a giant red rectangle:

 

Do you know what might cause it?

 

Thank you!

Hi @babao,

I think Takashi's solution should work for georeferenced or non-georeferenced images. If you inspect the image beforehand, does the output make sense? Does it cover the same area? Where are the red pixels you expect to be output? Can you compare the two images side by side to see where the unexpected data is?

 

 

If you are able to share your source image and workspace the community might be able to further help troubleshoot.

 

Best,

Nathan


Reply