Color Processing
color_processing
Helper functions for color math.
Functions:
-
XYZ_to_kelvin–Convert from CIE XYZ 1931 to the CCT in kelvin.
-
calc_exposure–Calculates exposure value of the rgb image.
-
encode_ARRILogC3–Encode the ARRI Log C3 EOTF.
-
kelvin_to_XYZ–Convert from a CCT in kelvin to CIE XYZ 1931.
-
rec709_to_displayP3–Convert from rec. 709 to diplay P3 gamut.
-
xyz_to_displayP3–Convert from CIE XYZ 1931 to diplay P3 gamut.
-
xyz_to_srgb–Convert from XYZ (D65) to sRGB using CuPy.
XYZ_to_kelvin
XYZ_to_kelvin(XYZ)
Convert from CIE XYZ 1931 to the CCT in kelvin.
calc_exposure
Calculates exposure value of the rgb image.
encode_ARRILogC3
encode_ARRILogC3(x)
Encode the ARRI Log C3 EOTF.
kelvin_to_XYZ
kelvin_to_XYZ(CCT)
Convert from a CCT in kelvin to CIE XYZ 1931.
rec709_to_displayP3
rec709_to_displayP3(rgb)
Convert from rec. 709 to diplay P3 gamut.
xyz_to_displayP3
xyz_to_displayP3(XYZ, **kwargs)
Convert from CIE XYZ 1931 to diplay P3 gamut.
xyz_to_srgb
xyz_to_srgb(XYZ, M=None, output_uint8=True, clip=True, apply_matrix=True)
Convert from XYZ (D65) to sRGB using CuPy.
Parameters:
-
(XYZndarray) –Input array of shape (..., 3), dtype float32 or float64.
-
(output_uint8bool, default:True) –If True, returns output in 0–255 uint8 range.
-
(clipbool, default:True) –If True, clips RGB values to [0, 1] before gamma.
Returns:
-
–
cp.ndarray: sRGB values, same shape as XYZ (or uint8 if output_uint8 is True).