phenotypic.sdk_.colourspace.encode_srgb#

phenotypic.sdk_.colourspace.encode_srgb(arr: numpy.ndarray) numpy.ndarray[source]#

Convert linear-light values to sRGB gamma-encoded values.

Applies the forward sRGB colour component transfer function elementwise. This is the inverse of decode_srgb() and restores the display-encoded representation after processing in linear light.

Parameters:

arr (numpy.ndarray) – Array of linear-light values normalized to [0, 1]. Any shape; the transfer function is applied elementwise.

Returns:

sRGB gamma-encoded values in [0, 1] as float64, same shape as arr.

Return type:

np.ndarray