darsia.EOTF#

class EOTF[source]#

Bases: object

Electro-optical transfer function (EOTF),the standard transfer function for sRGB, cf. https://en.wikipedia.org/wiki/SRGB

Define look up table (LUT), representing the EOTF.

Methods

adjust(image)

Apply EOTF using the look up table.

inverse_approx(image)

Apply approximate of the inverse of EOTF using the look up table.

adjust(image)[source]#

Apply EOTF using the look up table.

Parameters:
imagenp.ndarray

Image in linear RGB (uint8) format.

Returns:
np.ndarray

Image with tranformed color space, with values in [0,1].

inverse_approx(image)[source]#

Apply approximate of the inverse of EOTF using the look up table. In order to apply the exact inverse, the expensive function colout.cctf_encoding would have to be applied to all pixels (with values in [0,1]). By restricting the allowed input values to uint8 values, allows for faster LUT.

Parameters:
imagenp.ndarray

Image in gamma-corrected RGB format with values in [0,1].

Returns:
np.ndarray

Image in linear RGB (uint8) format.