Skip to main content
Solved

Removing green colored areas in Raster

  • June 5, 2019
  • 2 replies
  • 44 views

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.

 

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

takashi
Celebrity
  • 7843 replies
  • 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
  • 2252 replies
  • 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.