0

I'm using the following command of gdal_translate to convert GTiff files to JP2 format:

gdal_translate image.tif image.jp2 -of JP2OpenJPEG -co QUALITY=25 -ot Int16

However, the output JP2 image has a different range of values compared to the original GTiff image.

GTiff values ranges from -3000 to 9994 and JP2 ranges from -3574 to 9860.

I already tried changing the quality parameter, but the range is still different. Isn't there a way to keep the output image range the same as the input?

Thanks Julio.

Julio
  • 13
  • 2
  • You will most likely need lossless compression. The relevant instructions are here https://gdal.org/drivers/raster/jp2openjpeg.html#lossless-compression – Robert Davy Mar 15 '22 at 03:48
  • I used these lossless compression and the results didn't change too much. I realized that the original range values are stored in the XML file created by gdal_translate, but the values stored in the outuput JP2 file change and differ from the original range. – Julio Mar 17 '22 at 16:50

0 Answers0