Question

Change of pixel values when converting formats

  • 3 December 2018
  • 5 replies
  • 5 views

Badge

Hi,

 

I am trying to convert a JP2 file into a GeoTiff file, but the pixels of the resulting image have different values from the original one. I got a warning that says "Set the Photometric Interpretation as MINISBLACK", but after doing that, the results remains the same, that is, different pixel values.

Why?


5 replies

Badge +22

The only time I've seen that happening is if the jp2 pyramids were somehow corrupted, and were displaying the wrong values.

 

 

Tif -> jp2 change of pixels is expected (unless compression is set to 0)

 

jp2-> tif should give exactly the same results.
Userlevel 5
Badge +25
Like @jdh said: JP2 to TIFF should be lossless, but check the writer feature type parameters. Under Compression set the Compression Method to "none", it should default to that but it doesn't hurt to check. I've just tried this and a spot check of pixel values shows no differences.

 

Badge

The only time I've seen that happening is if the jp2 pyramids were somehow corrupted, and were displaying the wrong values.

 

 

Tif -> jp2 change of pixels is expected (unless compression is set to 0)

 

jp2-> tif should give exactly the same results.

There's no compression at all and the values change. It happens even if the Reader and the Writer are both in JP2. Can't believe it!

Badge
Like @jdh said: JP2 to TIFF should be lossless, but check the writer feature type parameters. Under Compression set the Compression Method to "none", it should default to that but it doesn't hurt to check. I've just tried this and a spot check of pixel values shows no differences.

 

There's no compression at all and the values change. It happens even if the Reader and the Writer are both in JP2. Can't believe it!

Userlevel 5
Badge +25

There's no compression at all and the values change. It happens even if the Reader and the Writer are both in JP2. Can't believe it!

 

If you set the "Compress by percentage" parameter to 0 in the writer feature type properties it should not change pixel values according to the documentation, but doublechecking it in the Data Inspector does show that some pixels have changed a little bit. 1-2 steps in RGB, too small to visually detect, but still a difference.

@NatalieAtSafe, could you get somebody from support to take a look at this? The documentation seems to imply that a value of 0 results in a lossless compression but in my testcase the output file has slightly different pixel values and is three times larger than the original.

Reply