[gdal-dev] GDAL 1.11 vs 2.1 and JPEG2000?

Jim Lacy lacy at wisc.edu
Wed Jan 6 11:32:04 PST 2016


Thanks Even.  I was actually more curious about the quality differences of jpeg2000, GDAL 1.11 vs 2.1.  File size is important too, of course.

I did some further tests.  For example, in GDAL 1.11.2:
gdal_translate -of JP2OpenJPEG -b 1 -b 2 -b 3 -co "QUALITY=12" Kenosha.tif Kenosha_gdal1_11.jp2

compared to GDAL 2.1:
gdal_translate -of JP2OpenJPEG -b 1 -b 2 -b 3 -co "QUALITY=12" -co "YCC=OFF" Kenosha.tif Kenosha_gdal2_1_ycc_off.jp2

.... produces results that are visually identical.  

However, simply by turning YCC=ON (the default) in GDAL 2.1 produces noticeably "better" images at higher zoom levels.  
gdal_translate -of JP2OpenJPEG -b 1 -b 2 -b 3 -co "QUALITY=12" -co "YCC=ON"  Kenosha.tif Kenosha_gdal2_1.jp2

It's interesting to me that the simple addition of YCC=OFF can noticeably affect the visually quality of the output image.  I certainly don't claim to understand the nuances of jpeg2000!

If you have time/interest, my test files are here:
https://uwmadison.box.com/s/xfc2f0ehwe6x6nu7chxu3ykvmk46mw85

Thanks again.


-----Original Message-----
From: Even Rouault [mailto:even.rouault at spatialys.com] 
Sent: Wednesday, January 06, 2016 4:25 AM
To: gdal-dev at lists.osgeo.org
Cc: Jim Lacy
Subject: Re: [gdal-dev] GDAL 1.11 vs 2.1 and JPEG2000?

Le mardi 05 janvier 2016 18:51:03, Jim Lacy a écrit :
> Can anyone with knowledge of the JP2OpenJPEG driver confirm or deny 
> the following observation?
> 
> I've been generating jpeg2000's in both GDAL 1.11.2 and GDAL 2.1.  
> With all settings the same, I've noticed the visual quality of the 
> images generated in GDAL 2.1 are noticeably "better." (a subjective 
> term, yes)
> 
> To my eyes, in 1.11.2,  -co "QUALITY=20" yields results visually 
> comparable to roughly -co "QUALITY=12" in GDAL 2.1.  Win32 platform, 
> binaries from gisinternals.com.
> 
> Are there significant improvements in the 2.1 driver that would 
> explain my observation?

Jim,

Checking the NEWS, I believe this might be related to this improvement I did in GDAL 2.0

 * add YCC creation option to do RGB->YCC MCT, and turn it ON by default
(#5634)

And a quick test confirms it with a BMNG 21600x21600 3 bands :

$ gdal_tanslate in.tif out1.jp2 -of jp2openjpeg $ gdal_tanslate in.tif out2.jp2 -of jp2openjpeg -co YCC=OFF $ ll out1.jp2 out2.jp2
-rw-r--r-- 1 even even 111977681 2016-01-06 11:07 out1.jp2
-rw-r--r-- 1 even even 151981743 2016-01-06 11:08 out2.jp2

RGB->YCC MCT conversion is a step that occurs before other processings, 
RGB->which
tends to decrease the size of the resulting file, all other things equal. This transform is not completely lossless when using the default lossy compression (there's a lossless version that is used when using -co QUALITY=100 -co REVERSIBLE=YES), but the differences in pixel values tend to be very small between YCC=ON/OFF.

Even

--
Spatialys - Geospatial professional services http://www.spatialys.com


More information about the gdal-dev mailing list