Skip to main content
Question

Change of pixel values when converting formats


Forum|alt.badge.img

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

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • December 3, 2018

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.

redgeographics
Celebrity
Forum|alt.badge.img+49
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.

 


Forum|alt.badge.img
  • Author
  • December 5, 2018
jdh wrote:

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!


Forum|alt.badge.img
  • Author
  • December 5, 2018
redgeographics wrote:
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!


redgeographics
Celebrity
Forum|alt.badge.img+49
deckard wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings