Re: Converting HDR to sRGB for Display

The hard part here is that a sophisticated knee is necessary to properly protect highlights when converting from HDR to SDR.  Without the knee, a lot of detail is lost.

If you donít use a knee, the result is much darker imagery.

Chris Seeger

From: Lars Borg <>
Date: Monday, February 7, 2022 at 4:35 PM
To: Simon Thompson - NM <>, <>
Subject: [EXTERNAL] Re: Converting HDR to sRGB for Display
You donít want this to depend on values on the canvas or anywhere.
The (canvas) values are dynamic. Any new action or time can result in new values.
Including being in range or out of range 0-1.
It would be awkward to implement and an awkward user experience if there is a color change as you cross the boundary.
Also, the script may want to know upfront if extended range is supported.
Thus the space selection needs to be made explicitly.

Somehow the below seems more complicated than I would expect.
Many non-web apps and OSs already display HDR/SDR content including diffuse white level and clipping and I donít want yet another method for doing it. Unwanted because a/ appearance doesnít match existing display paths, b/ yet another code path to maintain, c/ yet another non-standard solution, adding to industry confusion.

Are there any standards-based solutions for displaying mixes of SDR and HDR that we can apply here?
If not, are any of the already existing proprietary solutions candidates for standardization?


From: Simon Thompson <>
Date: Monday, February 7, 2022 at 6:31 AM
To: "" <>
Subject: Converting HDR to sRGB for Display
Resent-From: <>
Resent-Date: Monday, February 7, 2022 at 6:30 AM

Hi all,

Iíve been giving some more thought to the issues highlighted in the last call.

It would be preferable if the connection space contained only data within the sRGB range to just map it directly to sRGB.  However, if the connection space has values outside sRGB (i.e. outside the range 0-1) it would be preferable to map the connection space to sRGB.

Is it possible to test the max and min values of the RGB data?

To connect the connection space with HDR data to an sRGB monitor, one can convert to HLG then apply:

function tonemapREC2100HLGtoSRGBdisplay(r, g, b) {
  const systemGamma = 2.2;
  const r1 = simpleTransform(r, systemGamma);
  const g1 = simpleTransform(g, systemGamma);
  const b1 = simpleTransform(b, systemGamma);
  const [r2, g2, b2] = matrixXYZtoSRGB(matrixBT2020toXYZ(r1, g1, b1));
  const r3 = simpleInverseTransform(r2, systemGamma);
  const g3 = simpleInverseTransform(g2, systemGamma);
  const b3 = simpleInverseTransform(b2, systemGamma);
  const [r4, g4, b4] = limitTosRGBGamut(r3, g3, b3);
  return [r4, g4, b4];

Secondly, if the Operating System requires the diffuse white level to be scaled to a user defined value, do we need to:

∑         create a method to scale the luminance, and
∑         ensure that the highlights arenít clipped when displayed on a monitor which can not manage the matching peak luminance value?

Best Regards


Simon Thompson MEng CEng MIET
Senior R&D Engineer
BBC Research and Development South Laboratory

Received on Monday, 7 February 2022 22:06:43 UTC