ledoge / jxr_to_avif

HDR JPEG-XR -> AVIF converter
GNU General Public License v3.0
16 stars 2 forks source link

Works great, but some details get lost on conversion #1

Open Berny23 opened 1 year ago

Berny23 commented 1 year ago

Overall it looks great, but some highlights get lost on conversion. Here is an example where the red lines in the background lose highlights and detail.

Windows-Fotoanzeige 05 11 2023 20_48_25

output avif (3440×1440) - Google Chrome 05 11 2023 20_48_12

ledoge commented 1 year ago

Hm, that does look like a bug. Can you upload the .jxr file?

Berny23 commented 1 year ago

I packed it because GitHub doesn't allow the JXR file type: Screenshot 2023-11-03 22-22-21.zip

ledoge commented 1 year ago

I played around a bit with that file, but I'm still not entirely sure where the differences are coming from. At least some of it is down to Chrome's tone mapping, because when I encode it in 8 bit 4:4:4, the highlights look a bit dimmer in Chrome than in WCG Image Viewer (with the SDR brightness slider at 31 = 204 nits, so Chrome should be a tiny bit brighter than reference). When I encode it as 10 or 12 bit 4:2:0, WCG Image Viewer silently fails to open it and just shows black. The Windows Photos app does at least open it, but the colors are very wrong, even at 8 bit 4:4:4... Not really sure what to make of all this, but without having a known-good application that can open jxr and avif files and actually display them accurately, it's hard to say if these differences are actually caused by the files or by the applications.

I should probably add some command line options for different output formats to make troubleshooting like this easier.

clshortfuse commented 11 months ago

HDR + WCG app reports the JXR to be 1250 nits. Chrome dims it for me.

My 649 nit JXRs get brightened by Chrome. I would take a guess that Chrome targets 1000 nits. I don't think it's an AVIF conversion problem.

I would look into: https://bugs.chromium.org/p/chromium/issues/detail?id=1339333