-
Notifications
You must be signed in to change notification settings - Fork 649
fix(JXL): Correctly set Quality for JPEG XL #4933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Jonathan Brown <[email protected]>
Signed-off-by: Jonathan Brown <[email protected]>
Signed-off-by: Jonathan Brown <[email protected]>
|
Looks reasonable to me, but I'm not a JXL expert. @1div0 any thoughts? |
|
I will check++ Had free(time_t t) where t equals to 0 |
|
@1div0 Any chance to look at this? It's short, and it's certainly safe, I just seek a second opinion on whether it seems like a wise improvement to behavior. |
|
@1div0 thoughts? |
|
You can test the behaviour by encoding with OIIO without this PR and cjxl at the same quality setting. |
|
OK |
|
@1div0 Does that mean "ok, I will take a look", or "I looked and I think this is ok?" |
|
@lgritz the second one. The usage of distance = JxlEncoderDistanceFromQuality(compqual.second); is right. |
|
Thanks, I appreciate the check from you. |
Distance in JPEG XL isn't linear, causing previous quality settings to scale between lossless and visually lossless, instead of lossless and the lowest quality.
Thankfully libjxl has a built in function to convert Quality to Distance, so I've swapped it in.
Unable to test it myself, but it's a simple fix that I ran by another libjxl dev too.