Skip to main content
Solved

Removing green colored areas in Raster


In my classified raster image I have 3 different green colors and there are also other colors in the image. I would like to remove the green areas or make them transparent. Is there a way to do this automatically for multiple images?

Best answer by gio

@fluusha

You can remove or replace colors using a rasterexpression evaluator.

4 expressions, one to grab the colors and replace with transparency channel and 3 to "preserve" the rest.

Like this.

Here green RGB 153,192,30 is removed and replaced by full transparency.

Turning

 

 

in

 

You can have it read content of a folder dynamically and process the images in those folders.

 

 

View original
Did this help you find an answer to your question?

2 replies

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • June 5, 2019

Can you define the "green" with some specific R, G, B values or ranges of R, G, B?


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • Best Answer
  • June 5, 2019

@fluusha

You can remove or replace colors using a rasterexpression evaluator.

4 expressions, one to grab the colors and replace with transparency channel and 3 to "preserve" the rest.

Like this.

Here green RGB 153,192,30 is removed and replaced by full transparency.

Turning

 

 

in

 

You can have it read content of a folder dynamically and process the images in those folders.

 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings