Skip to content

Commit 2a0212b

Browse files
committed
[css-color-hdr] more transfer function stuff
1 parent e34d0d1 commit 2a0212b

File tree

1 file changed

+47
-2
lines changed

1 file changed

+47
-2
lines changed

css-color-hdr/Overview.bs

+47-2
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ Predefined colorspaces for HDR: {#predefined-HDR}
108108
encoded values are mixed up.
109109
Add examples showing conversion from binary values to the [0, 1] range.
110110

111+
Issue: should this specification recommend that the CSS Object Model
112+
store these values in the 16-bit half-floating point representation
113+
(IEEE standard 754-2008.)
114+
from BT.2100 pp. 9-10? (or any wider representation, like float or double)?
115+
111116
Issue: should the range be in absolute nits, ie [0.0, 10,000]?
112117

113118
The Perceptual Quantizer (PQ) electro-optical transfer function is used
@@ -118,7 +123,7 @@ Predefined colorspaces for HDR: {#predefined-HDR}
118123
In contrast to SDR colorspaces and some HDR colorspaces,
119124
the values are absolute rather than relative.
120125

121-
Issue: add a diagrram showing SDR and HDR dynamic ranges on a log scale
126+
Issue: add a diagram showing SDR and HDR dynamic ranges on a log scale
122127

123128
It has the following characteristics:
124129
(The display primaries are the same as [[!Rec.2020]]):
@@ -134,6 +139,8 @@ Predefined colorspaces for HDR: {#predefined-HDR}
134139
<tr><th>Black luminance</th><td colspan="2">0.001 cd/m²</td></tr>
135140
</table>
136141

142+
Issue: from BT.2100 p.3 "Note 3d – For PQ in a non-reference viewing environment, or for HLG (in any viewing environment), the black level should be adjusted using the PLUGE test signal and procedure specified in Recommendation ITU-R BT.814."
143+
137144
<div class="example">
138145
This color represents a blinding white
139146
with a luminance of 10,000 cd/m².
@@ -166,6 +173,43 @@ Predefined colorspaces for HDR: {#predefined-HDR}
166173

167174
Issue: add other examples, including encoding of sRGB red, green, blue and P3 red, green, blue.
168175

176+
Linear-light RGB signals are converted to PQ encoded as follows. An absolute luminance scale is used, so the luminance of diffuse (media) white is required to scale relative luminances. The maximum encodable value (peak, small-area white) in PQ is 10,000 cd/m²:
177+
178+
<!-- From Froehlich p.42
179+
and BT.2100 Table 4 p.4 Reference PQ OETF
180+
-->
181+
182+
<pre class="lang-javascript">
183+
var Er; // the red, green or blue component, [0, 1] for SDR, [0, 70ish] for HDR
184+
var Yw = 140; // the absolute luminance of diffuse white, cd/m²
185+
var x = Er * Yw / 10000; // absolute luminance of peak white is 10,000 cd/m².
186+
const n = 2610 / (2 ** 14);
187+
const m = 2523 / (2 ** 5);
188+
const c1 = 3424 / (2 ** 12);
189+
const c2 = 2413 / (2 ** 7);
190+
const c3 = 2392 / (2 ** 7);
191+
xPQ = (((c1 + (c2 * (x ** n))) / (1 + (c3 * (x ** n)))) ** m);
192+
193+
</pre>
194+
xPQ is the "gamma-corrected" (OETF-adjusted) signal [0, 1].
195+
196+
PQ encoded values are converted to linear-light as follows:
197+
198+
<!-- from BT.2100 Table 4 p.4 Reference EOTF -->
199+
200+
<pre class="lang-javascript">
201+
var xPQ; // the red, green or blue PQ-encoded component, [0, 1]
202+
const ninv = (2 ** 14) / 2610;
203+
const minv = (2 ** 5) / 2523;
204+
const c1 = 3424 / (2 ** 12);
205+
const c2 = 2413 / (2 ** 7);
206+
const c3 = 2392 / (2 ** 7);
207+
var x = (((Math.max(((xPQ ** minv) - c1), 0) / (c2 - (c3 * (xPQ ** minv)))) ** ninv);
208+
var Yw = 140; // the absolute luminance of diffuse white, cd/m²
209+
var Ea = x * 10000; // absolute luminance, [0, 10,000].
210+
var Er = x * 10000 / Yw; // luminance relative to diffuse white, [0, 70 or so].
211+
</pre>
212+
169213

170214
<dfn export>rec2100-hlg</dfn> {#valdef-color-rec2100-hlg}
171215
---------------------------
@@ -195,7 +239,7 @@ Predefined colorspaces for HDR: {#predefined-HDR}
195239
<tr><th>White chromaticity</th><td>0.3127</td><td>0.3290</td></tr>
196240
<tr><th>Transfer function</th><td colspan="2">Hybrid log Gamma</td></tr>
197241
<tr><th>Peak white luminance</th><td colspan="2">12 times reference white</td></tr>
198-
<tr><th>Black luminance</th><td colspan="2">depends on reference white</td></tr>
242+
<tr><th>Black luminance</th><td colspan="2">depends on reference white, see text</td></tr>
199243
</table>
200244

201245
Issue: add other examples
@@ -221,6 +265,7 @@ Predefined colorspaces for HDR: {#predefined-HDR}
221265
Linear-light RGB signals are converted to HLG encoded as follows [[Rec.2390]]:
222266

223267
<!-- From BT.2390 p.26
268+
confirmed with Froehlich p.43
224269
-->
225270

226271
<pre class="lang-javascript">

0 commit comments

Comments
 (0)