Turns out while JXL stores values >1.0, it considers them out of gamut (§ 4.1.4), and has a “nominal range of [0, 1]”. So I still don’t know what HDR is! And thus their ‘Intensity Target’ seems more of a maxCLL or peak mastering luminance.
On macOS and fltgui/hdr_avg_nits, I don’t know but I think the system always takes control of the brightness of (1, 1, 1). Here’s a WWDC talk on their system from 5 years ago, which I suspect many would find excruciating. However there’s SMPTE ST 2094-50 from a few months ago, authored mostly by Apple and Google, which at a glance looks like a similar idea. I’ll try to read it.
Only some primaries and transfer functions supported (though it should warn you if you try to use the unsupported ones).
AdobeRGB being weird.
Maybe EXIF works?
Should build fine on Linux and macOS, but not extensively tested. The macOS bundling would need some adjustments to work properly (but I’ve got it working locally) due to homebrew things. Windows not at the moment as I don’t know how to do the equivalent of these lines in the Windows config.mk but for libjxl:
Generally likely to be bad because the most sophisticated C I’ve previously written was a terrible quicksort algorithm earlier this year that took me days and ended up slower then my mergesort. And I still haven’t reached the chapter on pointers.
Ooh you’re back! I haven’t made a PR yet — it isn’t really finished and there were some other issues and questions I meant to ask. But I can make one if that’s an easier place to discuss things.
really nice hud! 20ms present delay for 4ms gpu processing sounds worrying. maybe try the other swapchain modes intgui/vk_present_mode:1 in vkdt/config.rc.
anyways, jxl write support is now merged, thanks for the contribution!
btw i use
intgui/allowhdr:1
fltgui/hdr_avg_nits:50
with an sdr monitor with the sway compositor for colour managed output that looks near identical to sdr display of exported images in say swayimg or eog. maybe that’s a secret scaling factor applied to PQ in this compositor chain.
right. that’s exactly the “nobody knows the factor” discussion right there. in my particular example the quest is to find out what sway or wayland (dunno who’s responsible here, don’t feel like searching through the source now) think what (a) is the number of nits pq in the swapchain encodes and (b) the peak luminance of my monitor is. this will then be used to compute some scale factor. in the sdr application, i wish to compensate that, so that 1.0 in vkdt will correspond to peak luminance of my sdr monitor.
note that this is only about 10bpc pq encoding of the swap chain image for display, not about storing in jxl.
really nice hud! 20ms present delay for 4ms gpu processing sounds worrying. maybe try the other swapchain modes intgui/vk_present_mode:1 in vkdt/config.rc.
There are a lot of fun metrics, not that I know what nearly any of them mean. I gave a quick try of intgui/vk_present_mode:1 but it didn’t seem to affect the present delay, which seems to fluctuate in the range of 20–25ms on my machine. I assume there are a number of performance oddities on Mac, what with MoltenVK, macOS and Metal, and the unusual (relative to other desktop GPUs) design of the Apple Silicon GPUs. But one wouldn’t complain
I’m writing a further thing on the PQ encoding, but it keeps growing longer so I’ll leave it for a later comment. But just would note that the fltgui/hdr_avg_nits: setting still doesn’t seem to affect anything on macOS (but I can see the effect on Linux with Mutter).