Skip to content

jxlssave produces XYB encoded JXL images when setting distance=0 #2818

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

Closed
f1ac opened this issue May 22, 2022 · 4 comments
Closed

jxlssave produces XYB encoded JXL images when setting distance=0 #2818

f1ac opened this issue May 22, 2022 · 4 comments
Labels

Comments

@f1ac
Copy link

f1ac commented May 22, 2022

When trying to produce lossless JXL images, currently XYB encoded images are generated, and they are not technically lossless. libjxl will generate an error in this case in upcoming builds, see libjxl/libjxl#1270

As I understand basic_info.uses_original_profile should be true if the file is lossless to avoid XYB encoding, and false otherwise for better compression. I can see "jxl->info.uses_original_profile = TRUE;" line in the encoder, so not sure why this issue happens.

Reproducible in 8.12.2 and latest master on windows.

@f1ac f1ac added the bug label May 22, 2022
@f1ac f1ac changed the title jxlsave produces XYB encoded images when setting distance=0 vipssave produces XYB encoded images when setting distance=0 May 22, 2022
@f1ac f1ac changed the title vipssave produces XYB encoded images when setting distance=0 vipssave produces XYB encoded JXL images when setting distance=0 May 22, 2022
@f1ac f1ac changed the title vipssave produces XYB encoded JXL images when setting distance=0 jxlssave produces XYB encoded JXL images when setting distance=0 May 24, 2022
@f1ac
Copy link
Author

f1ac commented May 24, 2022

Looked at wrong branch, indeed current master has 'jxl->info.uses_original_profile = JXL_FALSE;' which causes all files to become XYB encoded. I think the correct way to handle this is to change this line to 'jxl->info.uses_original_profile = jxl->lossless;'

@jcupitt
Copy link
Member

jcupitt commented May 26, 2022

I tried this, but it just makes jxlsave lock up if uses_original_profile is TRUE. There must be some other change needed as well.

I should probably sit down and read cjxl again :(

@f1ac
Copy link
Author

f1ac commented May 26, 2022

Didn't lock up for me when I tried lossless conversion using add-more-libjxl-metadata branch where uses_original_profile is TRUE, I only tried with float images though.

@jcupitt
Copy link
Member

jcupitt commented May 30, 2022

I think this is resolved now.

@jcupitt jcupitt closed this as completed May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants