Help with HLG profile

Hi,

I have an action item in the ICC Display Working group to develop an HLG based iccMAX display profile.  In order to understand how to go about it I've first prototyped functionality in Matlab/Octave.

The attached zip file has my code along with the BT2100 document that I'm using to implement.  The problem is that for a display profile you need to have both device to PCS as well as PCS to device transforms.

The device to PCS transform is conceptually implemented in HLG_FullToXYZ.m, and the PCS to device is conceptually implemented in HLG_XYZToFull.m  (I'm using full 0.0 to 1.0 range encoding in this case).  Alternatively one could use the HLG_Narrow12ToXYZ.m and HLG_XYZToNarrow12.m to use the narrow 12-bit integer encoding.

The problem is that the OOTF (implemented in HLG_EOTF.m)  and inverse OOTF (implemented in HLG_invEOTF) functions are not logical inverses of each other (from what I can tell from the docs).

For the 0.0 and 1.0 values I get a correct round trip.
>> HLG_XYZToFull(HLG_FullToXYZ([1.0;1.0;1.0]))
ans =

   1.0000
   1.0000
   1.0000

But for an intermediate value I don't get a correct round trip.
>> HLG_XYZToFull(HLG_FullToXYZ([0.5;0.5;0.5]))
ans =

   0.17755
   0.17755
   0.17755

So here are a few questions and observations.
*Have I implemented what is written in the spec correctly?
*If yes then what do I do about inversion?  I think that the problem is that the definition for the inverse OOTF is not a correct inversion of the OOTF.  I don't see a simple way of correcting it.  I could possibly create a sampled inverse curve based on earching for results using the OOTF.  Interestingly the XYZ to Display transform (probably the transform more often used in a system) would then be not be functional but interpolated.

*Also it would be incredibly helpful to better understand what is the purpose of having an HLG ICC profile?

Any help / guidance would be appreciated.

Max Derhak (PhD)
Principal Scientist

ONYX Graphics, INC.
6915 High Tech Drive | Salt Lake City, UT, 84047 | USA
DIR +1 801 984-5339 | www.onyxgfx.com<http://www.onyxgfx.com/>

Received on Thursday, 17 May 2018 20:25:58 UTC