Question

How to remove the dark/white background of ECW?

  • 15 December 2021
  • 6 replies
  • 86 views

Hi,

 

After converting the tif to ecw, ecw always comes with a background. I don't see the background in FME inspector or ArcMap, but there is always a background in Smallworld. Is it a way to remove the background colour of the ecw?


6 replies

Badge +11

Hi @cynthia​,

I'd be curious if there's an alpha band on your output that masks the background in ArcMap and FME, but shows in Smallworld. You can inspect your ECW in FME's Data Inspector in the Feature Information Window to see if there's an alpha band present.

 

This article: Setting NoData and Adding Alpha Bands to Remove Black Borders covers some methods that are commonly used to remove the black border or background around an image. It might be worth trying to set NoData instead and see if that makes a difference for you.

Hi @cynthia​,

I'd be curious if there's an alpha band on your output that masks the background in ArcMap and FME, but shows in Smallworld. You can inspect your ECW in FME's Data Inspector in the Feature Information Window to see if there's an alpha band present.

 

This article: Setting NoData and Adding Alpha Bands to Remove Black Borders covers some methods that are commonly used to remove the black border or background around an image. It might be worth trying to set NoData instead and see if that makes a difference for you.

Hi @jovitaatsafe​,

Yes, you're right. After the conversion, it added an alpha band. I used the raster band remover to remove the band, but it doesn't remove the dark background for me.

Badge +11

Hi @jovitaatsafe​,

Yes, you're right. After the conversion, it added an alpha band. I used the raster band remover to remove the band, but it doesn't remove the dark background for me.

@cynthia​, are you able to share a sample ECW output file and if possible, a screenshot of what it looks like in Smallworld? I'm thinking the RasterBandNoDataSetter might be able to help but I could be wrong if the background isn't all one colour.

Hi @jovitaatsafe​,

Yes, you're right. After the conversion, it added an alpha band. I used the raster band remover to remove the band, but it doesn't remove the dark background for me.

@jovitaatsafe

Sorry, I'm not able to share the imagery due to the file size. I did use the RasterBandNoDataSetter, but it didn't work for me.

Badge +11

Hi @jovitaatsafe​,

Yes, you're right. After the conversion, it added an alpha band. I used the raster band remover to remove the band, but it doesn't remove the dark background for me.

Is there any reprojection happening in the writer perhaps with a different coordinate system specified than the source? I've seen some previous discussions about black borders happening after reprojecting because the image is no longer the same rectangular shape after reprojecting. There's a few good suggestions in the answer here that might be worth checking out: https://community.safe.com/s/question/0D54Q000080heAySAI/removing-nodata-from-raster This one suggests that if you have multiple bands, you may need to set no data multiple times (for each band). If that doesn't work, you may want to try setting your own alpha band next according to the article linked earlier.

 

If you're able to share an image of what your ECW output looks like in Smallworld, perhaps other folks in the Community may recognize your scenario and be able to chime in on it!

Hi @jovitaatsafe​,

Yes, you're right. After the conversion, it added an alpha band. I used the raster band remover to remove the band, but it doesn't remove the dark background for me.

@jovitaatsafe​ 

I'm not sure if it's because it isn't the rectangular shape. I've attached the smallworld screen shot for your reference.

Reply