Skip to main content
Solved

How to remove black areas from mosaicked ECW image?

  • October 19, 2022
  • 3 replies
  • 135 views

vxn43
Supporter
Forum|alt.badge.img+18

I have used RasterMosaicker to mosaic 4 ECW images into a single ECW image. Prior to mosaicking none of the images had black areas around the edges. After mosaicking my output shows two locations that are black on the edge of the image. 

 

I checked and these black areas have data, various values of 1,0,1; 0, 1, 0; 1, 2, 1; and several other values. Any suggestions on how to remove the black areas? I have tried Clipper and it does not clip the black areas, they remain in the output.

Best answer by hkingsbury

If by "remove black areas" you're meaning make them transparent, then (if i recall correctly) ECW doesn't support transparency. Additionally, because ECW is a lossy compression, you're going to notice things like this where "black" isn't "black".

 

You can set some range that classifies the "black" edges ( eg 0-10,0-10,0-10) to solid black in the workspace. however,

  1. When writing out to ECW again, you will likely see these change again
  2. You might remove/change valid dark areas in the imgarey
  3. as you get closer to the non black areas, you'll probably still have a "black" shadow as those values exceed the specified range
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.

3 replies

david_r
Celebrity
  • 8391 replies
  • October 20, 2022

Sounds like an aliasing effect due to the mosaicker. You can try to play around with the settings of the RasterMosaicker to see if that improves the result, if not you may have to implement something to "snap" these values to NODATA, e.g. using the RasterCellValueReplacer.


Forum|alt.badge.img+2
  • 1891 replies
  • October 20, 2022

@timh​ Does the workspace here give you what you need?


hkingsbury
Celebrity
Forum|alt.badge.img+63
  • Celebrity
  • 1620 replies
  • Best Answer
  • October 24, 2022

If by "remove black areas" you're meaning make them transparent, then (if i recall correctly) ECW doesn't support transparency. Additionally, because ECW is a lossy compression, you're going to notice things like this where "black" isn't "black".

 

You can set some range that classifies the "black" edges ( eg 0-10,0-10,0-10) to solid black in the workspace. however,

  1. When writing out to ECW again, you will likely see these change again
  2. You might remove/change valid dark areas in the imgarey
  3. as you get closer to the non black areas, you'll probably still have a "black" shadow as those values exceed the specified range