Skip to main content
Question

Change of pixel values when converting formats

  • December 3, 2018
  • 5 replies
  • 50 views

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?

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.

5 replies

jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • 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+60
  • Celebrity
  • 3702 replies
  • December 3, 2018
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
  • 3 replies
  • December 5, 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.

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
  • 3 replies
  • December 5, 2018
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+60
  • Celebrity
  • 3702 replies
  • December 5, 2018

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.