Skip to main content
Solved

ECW absolute value problem

  • February 27, 2023
  • 2 replies
  • 41 views

Hi,

 

I need to have parts of an othophoto in ECW format with absolute values. Previewing the raster in FME shows that the pixels have my preferred value of 0,0,0. When I write to geotif it works and I get the desired black areas with exactly 0,0,0, but not when I use an ECW writer. The black areas in the ECW have the black areas replaced with 1,0,1 or something similar. 

 

TIF with mask at 0,0,0:

TIF 

ECW with mask at 0,0,0:

ECW 

I have tried disabling the compression on the writer and removing the alpha band, but the result it the same. Any suggestions?

Best answer by daveatsafe

Hi @leif​,

The ECW compression is lossy, even when target compression percentage is set to 0, so it will not be possible to get exactly the same values back in all cases. I would recommend writing to GeoTIFF instead, using a lossless compression like LZW. You can configure the GeoTIFF writer to organize the image into tiles and overviews that will speed reading the images at different zoom levels, similar to ECW.

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

daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • 1637 replies
  • Best Answer
  • February 27, 2023

Hi @leif​,

The ECW compression is lossy, even when target compression percentage is set to 0, so it will not be possible to get exactly the same values back in all cases. I would recommend writing to GeoTIFF instead, using a lossless compression like LZW. You can configure the GeoTIFF writer to organize the image into tiles and overviews that will speed reading the images at different zoom levels, similar to ECW.


  • Author
  • 15 replies
  • February 28, 2023

Thank you, @daveatsafe​!

 

I was hoping to use ECW since it's simple and fast to setup, but I will go the GEOTIFF route. More manual optimization required, but it is worth it in the end with increased compatibility and flexibility.