Class SRLAB2

  • All Implemented Interfaces:
    ColorSpaceTransform

    public class SRLAB2
    extends Object
    implements ColorSpaceTransform
    The SRLAB2 color model is a compromise between the simplicity of CIELAB and the correctness of CIECAM02.

    In contrast to CIECAM02 or RLAB there are no parameters like the adapting luminance or the relative luminance of the surround; only the white point (which is assumed to be completely adapted) has to be known. Compared to RLAB the SRLAB2 model uses the more recent chromatic adaption model of CIECAM02.

    For a fixed white point, successive linear transformations can be precalulated to form a single matrix, which reduces the complexity of the calculations to two matrix vector multiplications and the componentwise application of the compression function. The SRLAB2 model is almost as easy to use as CIELAB, while overcoming its errors especially visible in hue-changes of blue colors. *

    Implementation of 'Deficiencies of the CIE-L*a*b* color space and introduction of the SRLAB2 color model'. See https://www.magnetkern.de/srlab2.html

    • Constructor Detail

      • SRLAB2

        public SRLAB2()
    • Method Detail

      • toRGB

        public double[] toRGB​(double[] color)
        Description copied from interface: ColorSpaceTransform
        Converts a color from the implementing color space to RGB. Implementations should focus on optimizing this conversion process for efficiency.
        Specified by:
        toRGB in interface ColorSpaceTransform
        Parameters:
        color - an array representing the color in the implementing color space. The specific meaning and length of this array depend on the color space.
        Returns:
        an array of three doubles representing the color in RGB, with each component normalized to the range [0, 1]. The output may exceed this range before display calibration or clipping is applied.
      • fromRGB

        public double[] fromRGB​(double[] RGB)
        Description copied from interface: ColorSpaceTransform
        Converts an RGB color into the corresponding color in the target color space.
        Specified by:
        fromRGB in interface ColorSpaceTransform
        Parameters:
        RGB - an array of three doubles representing the red, green, and blue components of the color, each normalized to the range [0, 1]
        Returns:
        an array of doubles representing the color in the target color space. The length and interpretation of this array depend on the specific color space.