Skip to content

Commit

Permalink
Use colour.algebra.spow in *ITU-R BT.1886* colour component transfe…
Browse files Browse the repository at this point in the history
…r functions.
  • Loading branch information
KelSolaar committed Sep 27, 2024
1 parent dc87522 commit b83a73d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions colour/models/rgb/transfer_functions/itur_bt_1886.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import numpy as np

from colour.algebra import spow
from colour.hints import ArrayLike, NDArrayFloat
from colour.utilities import as_float, from_range_1, to_domain_1

Expand Down Expand Up @@ -91,7 +92,7 @@ def eotf_inverse_BT1886(L: ArrayLike, L_B: float = 0, L_W: float = 1) -> NDArray
a = n**gamma
b = L_B**gamma_d / n

V = (L / a) ** gamma_d - b
V = spow(L / a, gamma_d) - b

return as_float(from_range_1(V))

Expand Down Expand Up @@ -151,6 +152,6 @@ def eotf_BT1886(V: ArrayLike, L_B: float = 0, L_W: float = 1) -> NDArrayFloat:
n = L_W**gamma_d - L_B**gamma_d
a = n**gamma
b = L_B**gamma_d / n
L = a * np.maximum(V + b, 0) ** gamma
L = a * spow(np.maximum(V + b, 0), gamma)

return as_float(from_range_1(L))

0 comments on commit b83a73d

Please sign in to comment.