assign hdr metadata and display hdr images

I use ExifToolGUI.

If present, the .icc profile information is shown under the tab ‘All’

I use ExifToolGUI.

If present, the .icc profile information is shown under the tab ‘All’

sure !

but tried it ! as already presented confer supra : it does display completely incorrect informations, tagging an hdr .jxr screenshot, or an [.exr, .hdr] hdr image as srgb which is absolutely not the case.
exiftool is unable to detect and identify the rec. 2100 st. 2084 pq information that allows the viewer [microsoft photos, hdr + wcg image viewer] to display the image as intended in hdr.
try exiftool on the obs.jxr in the onedrive link, and try to identify where the hdr metadata is kept.
if there was no difference why [microsoft photos, hdr + wcg image viewer] would display the image as hdr while another image with the same 16 bpc would display completely washed out, dull, colorless ?
it s because there is an embeded information somewhere in the file wether hidden in the metadata where exiftool or imagemagick cannot detect it or even directly binarized in the image data, holding the [rec. 2100, st. 2084] information.

Again, this assertion is WRONG for a format that stores high-precision floating point data like EXR and JXR do, and have supported HDR and WCG since LONG before the Rec. 2100 or Rec. 2020 standards existed.

scRGB - published in 2003
JPEG XR - published in 2009 - which again effectively extends scRGB further by eliminating the -0.5/+7.5 limits by supporting float32 (EDIT: And float16, which is what the files you have provided are using)
Rec. 2020 - published in 2012
Rec. 2100 - published in 2016

Standard/typical encoding for JXR is linear transfer function and sRGB primaries, since floating point allows you to use negative numbers to represent out-of-gamut colors, and PQ/HLG transfer functions only make sense for low-bit-depth integer encoding.

EVERY JXR file I’ve ever seen was linear scRGB.

Both obs.jxr and xboxgamebar.jxr that you provided are linearly encoded scRGB (note since this is a high contrast scene the preview in this screenshot is pretty aggressively tonemapped - RT’s DRC tool, etc.:

Both obs.jxr and xboxgamebar.jxr are HDR (maximum value in each is 1.94, anything greater than 1.0 is outside of the normal sRGB transfer function), but do not contain any out-of-gamut information for sRGB (most negative number is -1.78881393e-06, which is practically zero)

1 Like

Sorry, I failed to understand most of your original post, it seems. And I didn’t really understand the above because I don’t shoot HDR either.

For my Sigma cameras there is a utility which extracts ALL the meta-data, not just the EXIF.

Perhaps there is such a utility for your camera model by which you may find the information you seek.

Feel free to comb through the JPEG XR spec and let us know where and how the colour space information is supposed to be encoded.

Being proprietary software, there’s no way to know what Microsoft’s image viewers support and implement for each format. (And seeing that they are pushing JPEG XR, they could be treating in a special way.)

As for the (linear) sRGB assumption, @Entropy512 just explained why it is a valid one for floating point EXRs and JXRs. Just to back this up, in the absence of explicit colour primaries, OpenEXR indeed assumes sRGB/Rec709 ones by default: https://github.com/AcademySoftwareFoundation/openexr/blob/6258740337bf3859ed8abcf8d99a1671b2cdd06d/src/lib/OpenEXR/ImfChromaticities.h#L36-L50

2 Likes

This is where you went wrong. You say it’s nonfunctional - so why did you use it?

Per that link:
“Almost all pixel formats supported by JPEG XR can be loaded. Incompatible formats, however, will first be converted to a representation that GIMP understands (this means you’ll loose HDR data, for example). All RGB pixel formats are converted to 24bpp RGB, all RGBA formats to 32bpp BGRA, and all grayscale formats to 8bpp Gray. Black-white images are imported as indexed images.”

Note that it didn’t say you lost HDR metadata - it says (as is expected when trying to cram float16 into an int8) that you will lose data

If you really want to create a Rec. 2100 encoded 10bpp image from a JXR, you can start with the Python tool I linked, but it’ll need quite a bit of work since doing that was unnecessary for the original purposes of that script - it was designed to generate TIFFs that could be ingested into RawTherapee, so it doesn’t alter the data at all and tags it as linear with sRGB primaries, which matches every JXR file I’ve ever seen. You will need to:

  • Calculate the appropriate matrix for converting an image encoded with sRGB primaries to Rec.2020 primaries, I’d suggest https://www.colour-science.org/ for that
  • Apply that matrix to the float32 numpy array representing your image data after the script loaded an image
  • At this point you should not have any negative numbers - if you do, you probably made a math error because it’s extremely unlikely (but possible) that the image contains colors outside of the Rec. 2020 colorspace. (negative float16/float32 numbers are a signal of either a bug or out-of-gamut colors)
  • Take your image data that is now floating point linear with rec. 2020 primaries, and apply the HLG or PQ transfer functions
  • Export as HEIC/HEIF with appropriate metadata - I can’t help you here. Or export as int16 linear Rec2020 TIFF then feed that to ffmpeg to create a video clip, see Experimenting with HLG and HDR10 for still images - #22 by Entropy512 for an example
2 Likes

@xpatUSA, no issue thank for answering as well !
@kmilos, thank for the link !

@Entropy512, thank for this excellent and very informative answer !

copy, about the details involvintg the floating point encoding, the relation between the the standard and the creation of the format, right.

ok copy ! so it s linear with negative numbers ! that explains everything !

This is where you went wrong. You say it’s nonfunctional - so why did you use it?

tried it at the begining of these investigations and now that you explain why you loose the metadat based on the description, it a lot clearer.

but it’ll need quite a bit of work since doing that was unnecessary

then do you know a usable format that supports it natively ?

so you are saying that the tiff are holding the out of range data in negative numbers bu the viewer does not find it as it finds it in [.jxr, .exr, .hdr] ?
is there a way to display .tif in hdr like the obs.jxr ?
what would you use to display and create .hdr images ?

so does it means that if you fill an image in blue max value, you export it as .exr, .hdr, will this image once displayed in microsoft photos, hdr + wcg image viewer be in hdr ? will the value coded to 255 blue will be the max value that the display can output in hdr ?

do you know editing software that reoorts hdr in the swachain besides affinity photo ?
do you know other softwares than windows photos, hdr + wcg image viewer that displays [.jxr, .exr, .hdr] in hdr ?

No. Again, this is proprietary software, we can’t know what it does. If it supports floating point JPEG XR in some special way, it does not mean it will support floating point EXR and TIFF the same way.

1 Like

no. again, not talking about .jxr here, talking about [.exr, .hdr], if you fill it with full blue, will the color be at max luminance value ?
because tried it appears like it but is it really the case digiatlly ?
.jxr and windows photos are proprietary, but hdr + wcg image viewer is not so if you want to only use non proprietary software, do you know other hdr image viewer by the way ?

Hi,
Since this now seems to be not darktable-specific anymore, from my limited investigations, I found out that:

  • Google Chrome on Mac os should be able to display avif HDR images (with rec.2100 PQ at least)

  • maybe this works on windows too? I don’t know because I don’t use windows, but there’s a chance it might if you configure HDR output properly (which I don’t know how to do)

  • chrome on Linux will at least tonemap the HDR avif to sdr, so that it looks reasonable on a standard sdr display

  • on my TV, I can successfully trigger hdr output when using heif with either hlg or pq encoding (still rec.2100)

  • for both avif and heif, you need to tag the files properly. that means no ICC profiles, and use of the nclx box instead to specify the primaries and transfer function

HTH

1 Like

Try:

@agriggio and @kofa thank for the detailled suggestions !
definitely giving it a try !

There’s also

I have no experience with any of these, as I don’t do HDR.

There’s this thread, and the first comment references another:

Nice. On mine, I cannot - At least until 2-3 years ago, the only reliable content distribution format for HDR stills was to encode it to an HLG or PQ + Rec. 2020 10-bit H.265 video. (I linked to how I did that in one of my other posts)

At least in theory it might now be possible to create an HDR image viewer that works in full screen with gamescope on Linux (right now the only userspace that has HDR support…), but that’s extremely niche.

In general, HDR stills are a sh*tshow as far as support and compatibility. Float JXR works well in Windows, but on any other OS your best bet is to convert it to float TIF - and even then, that’s really only valid for feeding it to darktable, ART, or RT to tonemap it down to SDR, there are no HDR image viewers. MacOS seems to have the best support for HDR stills in the more well known/standardized formats (AVIF, HEIF/HEIC, etc)

@agriggio, the [.jxr, .exr, .hdr] images does not display at all with chrome on windows when you contextual menu\open with chrome.

@kofa, thank for the suggestion,

tried it, an the darktable_srgb.exr in the onedrive link which displays perfectly in hdr with hdr + wcg image viewer, displays with overexposed highlights and washed out colors with ‘hdrview’ and ‘tev’.

@agriggio. @Entropy512,

on my TV, I can successfully trigger hdr output when using heif with either hlg or pq encoding (still rec.2100)

Nice. On mine, I cannot

why not using the more reliable manual hdr enabling process ?
simillar to how it works on windows and on samsung tv :
_tv settings\‘uhd color hdmi’ : on
_windows settings\display\hdr switch : on
_nvidia control panel\change resolution\output color depth : 12 bpc.

@Entropy512

In general, HDR stills are a sh*tshow as far as support and compatibility. Float JXR works well in Windows, but on any other OS your best bet is to convert it to float TIF - and even then, that’s really only valid for feeding it to darktable, ART, or RT to tonemap it down to SDR, there are no HDR image viewers.

do you know any other hdr display software
besides :
editor :
_affinity photo (opens [.jxr, ,exr, .hdr] in hdr on hdr displays perfectly, edit in hdr on hdr displays, exports in hdr in [exr, .hdr, avif])
viewers :
_microsoft photo [opens .jxr in hdr on hdr displays perfectly]
_hdr + wcg image viewer [opens [.jxr, ,exr, .hdr] in hdr on hdr displays perfectly]
?

MacOS seems to have the best support for HDR stills in the more well known/standardized formats (AVIF, HEIF/HEIC, etc)

well standardized ? where ? do you know a viewer able to display .avif in hdr on hdr displays ?

Try avif.

I don’t know what you are talking about, sorry.

Try avif.

already tried with chrome, edge, opera gx : the image does not load at all.
besides this do you know any hdr viewer exist allowing to display avif in hdr ?

why not using the more reliable manual hdr enabling process ?

I don’t know what you are talking about, sorry.

you are apparently waiting for hdr to automatically switch on or something :
hdr does not automatically switch on, you have to switch hdr on manually following this procedure and it s more reliable than waiting for it to potentially switch on automatically :
doing it since 2018 when hdr became available on windows and never had any issue when displaying hdr content on windows.
here s the procedure :

_tv settings\‘uhd color hdmi’ : on (don t need to do it each time, leave it on it s to enable the greater input bandwith for 4k, rgb, full, 12 bpc, 30 hz max for hdmi. 2.0 or, 120 hz max for hdmi 2.1 )
_windows settings\display\hdr switch : on
_nvidia control panel\change resolution\output color depth : 12 bpc.

@Entropy512
can you explain why on this image when you take it in affinity photo or krita and you take one of the highest luminance bright with the color picker, you replicate the color with 2 brush lines, and the lines are not white but they are black, like to show that the color are out range or something ?
is it related to the negative values management you talked about earlier ?
do you know how to recreate these colors at these luminances in affinity, krita or, any other software ?

solved

strange how all the primaries supports 60 value but the pure blue can only go to 2 before it clips to purple with more than that.
do you know why ?