phenotypic.sdk_.colourspace.decode_srgb#
- phenotypic.sdk_.colourspace.decode_srgb(arr: numpy.ndarray) numpy.ndarray[source]#
Convert sRGB gamma-encoded values to linear light.
Applies the inverse sRGB colour component transfer function (the standard piecewise gamma curve) elementwise. Sensor and photon noise is generated in linear light, so denoisers and variance-stabilizing transforms (e.g. the Generalized Anscombe Transform) operate most correctly on linearized data rather than the display-encoded values.
- Parameters:
arr (numpy.ndarray) – Array of sRGB gamma-encoded values normalized to
[0, 1]. Any shape; the transfer function is applied elementwise, so a 2D channel or an(H, W, 3)image are both valid.- Returns:
Linear-light values in
[0, 1]asfloat64, same shape asarr.- Return type:
np.ndarray