1.0: JPEG-XL: Quality scales and file size

*** Please report new bugs here! ***

Moderators: helmut, XnTriq, xnview, Dreamer

simon
Posts: 52
Joined: Wed Aug 23, 2006 4:51 pm

1.0: JPEG-XL: Quality scales and file size

Post by simon »

Hello,
On MP1.00 / windows 10, quality scale for JPEG-XL behaves strangely. For values 9-99 (with compression let to default value 7), higher values result in larger files, as expected. In contrast, values equal or lower than 8 all result in the same file (same CRC) as the one obtained with quality=90.
simon
User avatar
masterjp
Posts: 275
Joined: Fri Feb 13, 2009 4:37 pm
Location: Duesseldorf, Germany

Re: JPEG-XL quality

Post by masterjp »

Yes, you are right. Something could be wrong in the quality setting or the jpeg xl compression library contains an error!
The jpeg xl en- and decoder is an early alpha version, which does not have all features of the final version.
It is currently in development.

I compressed one picture with different quality settings.

Q10 means Quality = 10 (all with effort / efficiency = 7)

Quality 10 results in smaller files than quality 5 !!!
The quality 5 file should be smaller than 10.
test_jxl.png
PC: Intel 8700k + Asus Z370-F + 16 GB RAM G.Skill
OS: Windows 10 Pro x64 (latest updates) | XN-View (latest stable version) |XnViewMP (latest stable version) | XnConvert (latest) | Adobe Photoshop Elements 2022 & Elements XXL 9
simon
Posts: 52
Joined: Wed Aug 23, 2006 4:51 pm

Re: JPEG-XL quality

Post by simon »

In my tests, I got exactly the same image (same CRC) with quality = 5 (or anything <= 8) and quality = 90
It is not a big issue because I do not think that many people will use so low quality values, but this sounds strange
simon
Posts: 52
Joined: Wed Aug 23, 2006 4:51 pm

Re: JPEG-XL quality

Post by simon »

I performed some additional tests, comparing what is done by cjxl.exe (downloaded from the jxl github webpage) and what is done by XnviewMP.

1) I got the exact same jxl images using both methods when setting quality in the range 10 to 95.

2) In contrast different results were obtained with quality = 5 or quality = 100 (lossless compression button in XnviewMP).
a) with quality = 5, cjxl.exe generates a file that is lighter than with quality = 10, whereas XnviewMP generates a very heavy file (corresponding to quality = 90 as mentioned in my previous post)
b) with quality = 100 (lossless), the jxl image obtained using cjxl.exe is, as expected, exactly the same as the original image (same CRC), but this is not the case when using XnviewMP

Consequently, It seems that the problem encountered in XnviewMP comes from the way XnviewMP calls the jxl library rather than from the jxl library itself: XnwiewMP appears to correctly calls the jxl library when quality is set in the range 10-95, which is fine, but to call it with wrong parameters when the quality is set to a very low value or when the lossless mode is selected
User avatar
xnview
Author of XnView
Posts: 37889
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: JPEG-XL quality

Post by xnview »

simon wrote: Wed Jun 15, 2022 9:39 am Consequently, It seems that the problem encountered in XnviewMP comes from the way XnviewMP calls the jxl library rather than from the jxl library itself: XnwiewMP appears to correctly calls the jxl library when quality is set in the range 10-95, which is fine, but to call it with wrong parameters when the quality is set to a very low value or when the lossless mode is selected
:bugconfirmed: Thanks to your detailed description I can reproduce the problem.
Pierre.