Skip to main content
Solved

Setting no data value to remove black borders also removes black from raster


I have about 3500 8-bit RGB geotiffs with black borders. I use the Clipper to remove/define the pixels that are outside my polygons to NoData. In combination with the RasterBandNodataSetter.

 

 

But when I use 0 as a value it also removes black pixels in my map. The same with 255, it also removes white from my map. I can't find a proper value to use without losing pixels in my map/raster.

 

 

Any suggestions for this? thanks!

Best answer by jdh

In a similar situation I used the RasterExpressionEvaluator to set my black pixels (0,0,0) to almost black (1,1,1) prior to clippping.  The difference is visually not noticeable.

 

 
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • August 13, 2015
In a similar situation I used the RasterExpressionEvaluator to set my black pixels (0,0,0) to almost black (1,1,1) prior to clippping.  The difference is visually not noticeable.

 

 

  • Author
  • August 14, 2015
Thank you very much for this tip JDH!

 

 

I used the RasterExpressionEvaluator to set the black pixels from 0,0,0 to 1,1,1 but there where still some missing pixels in the output. Not as much as before but still too much. So I also used the RasterCellValueReplacer after the RasterExpressionEvaluator to force remaining pixels with the 0 value to 1. And now my output is okay!

 

 

Thnks

 

 

 

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