Fig. 1: Nikon N-Log / Rec.2020 — CIE 1931 xy.Fig. 2: Nikon N-Log / Rec.2020 encoding curve, L = 0.18 × 2^stops. | x | y |
|---|
| Red | 0.7080 | 0.2920 |
| Green | 0.1700 | 0.7970 |
| Blue | 0.1310 | 0.0460 |
| White (D65) | 0.3127 | 0.3290 |
Transfer function
| Curve | Nikon-N-Log |
|---|
| Black / white point (10-bit code values) | 0 / 1023 |
|---|
| Linear 0 → code | 0.1244 |
|---|
| 18% grey → code | 0.3637 |
|---|
| Linear 1.0 → code | 0.6051 |
|---|
Encoding: convertFromLinear
vec4 convertFromLinear(vec4 val, int clip)
{
// From N-Log_Specification_(En)01.pdf
vec3 v10 = vec3
(
(val.r < 0.328) ? 650.0 * pow(max(val.r + 0.0075, 0.0), 0.3333) : 150.0 * log(val.r) + 619.0,
(val.g < 0.328) ? 650.0 * pow(max(val.g + 0.0075, 0.0), 0.3333) : 150.0 * log(val.g) + 619.0,
(val.b < 0.328) ? 650.0 * pow(max(val.b + 0.0075, 0.0), 0.3333) : 150.0 * log(val.b) + 619.0
);
return vec4(v10 / 1023.0, val.a);
}Decoding: convertToLinear
vec4 convertToLinear(vec4 val)
{
// From N-Log_Specification_(En)01.pdf
vec4 v10 = val * 1024.0;
return vec4
(
(v10.r < 452.0) ? pow(v10.r / 650.0, 3.0) - 0.0075 : exp((v10.r - 619.0) / 150.0),
(v10.g < 452.0) ? pow(v10.g / 650.0, 3.0) - 0.0075 : exp((v10.g - 619.0) / 150.0),
(v10.b < 452.0) ? pow(v10.b / 650.0, 3.0) - 0.0075 : exp((v10.b - 619.0) / 150.0),
val.a
);
}RGB → XYZ matrix
RGB → XYZ
[ 0.636958048301 0.144616903586 0.168880975164 ]
[ 0.262700212011 0.677998071519 0.059301716470 ]
[ 0.000000000000 0.028072693049 1.060985057711 ]
Use this space
Gamut compare ↗
Transfer compare ↗
Sources
- Nikon: N-Log Specification Document v1.0.0 (PDF)