Skip to main content
Solved

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

  • August 13, 2015
  • 2 replies
  • 101 views

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.

 

 
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

jdh
Contributor
Forum|alt.badge.img+40
  • 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