XYZ_normalized#
- colorsynth.XYZ_normalized(XYZ, axis=-1, axis_max=None)[source]#
Normalize the luminance of a vector in the CIE 1931 \(XYZ\) color space.
This function converts to the xyY color space, divides \(Y\) by its maximum so that the largest luminance is one, and then converts back into the XYZ color space.
- Parameters:
XYZ (ndarray) – color values in a CIE 1931 \(XYZ\) color space to be normalized
axis (int) – the axis along which the color space values are distributed
axis_max (None | int | tuple[int, ...]) – the axis or axes of XYZ along which to compute the maximum luminance, ignoring NaN values. If
None(the default), the maximum is computed over the entire array, so the result has a single global maximum luminance of one. For a stack of images, pass the axes of each image to normalize every image in the stack independently. May not contain axis.
- Return type: