Documentation of 'Catalano.Imaging.Tools.ColorConverter' Java class
ColorConverter
Catalano.Imaging.Tools

Class ColorConverter



  • public class ColorConverter
    extends java.lang.Object
    Convert between different color spaces supported. RGB -> CIE-L*A*B* -> RGB RGB -> CIE-L*c*h -> RGB RGB -> CMYK -> RGB RGB -> IHS -> RGB RGB -> HLS -> RGB RGB -> HunterLAB -> RGB RGB -> HSV -> RGB RGB -> RGChromaticity RGB -> XYZ -> RGB RGB -> YCbCr -> RGB RGB -> YCC -> RGB RGB -> YCoCg -> RGB RGB -> YES -> RGB RGB -> YIQ -> RGB RGB -> YUV -> RGB XYZ -> CIE-L*A*B* -> XYZ XYZ -> HunterLAB -> XYZ XYZ -> LMS -> XYZ XYZ -> xyY -> XYZ
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static int[] CMYKtoRGB(double[] cmyk)
      CMYK -> RGB
      static int[] CMYKtoRGB(double c, double m, double y, double k)
      CMYK -> RGB
      static int[] HSLtoRGB(double hue, double saturation, double luminance)
      HLS -> RGB.
      static int[] HSVtoRGB(double hue, double saturation, double value)
      HSV -> RGB.
      static int[] HunterLABtoRGB(double l, double a, double b)
      HunterLAB -> RGB.
      static double[] HunterLABtoXYZ(double l, double a, double b)
      HunterLAB -> XYZ
      static double[] IHStoRGB(double[] ihs)
      IHS -> RGB
      static double[] LABtoLCH(double[] lab)
      CIE-L*A*B* -> L*C*h
      static double[] LABtoLCH(double l, double a, double b)
      CIE-L*A*B* -> L*c*h
      static int[] LABtoRGB(double[] lab)
      CIE-L*A*B* to RGB.
      static int[] LABtoRGB(double[] lab, double[] tristimulus)
      CIE-L*A*B* to RGB.
      static int[] LABtoRGB(double l, double a, double b)
      CIE-L*A*B* to RGB.
      static int[] LABtoRGB(double l, double a, double b, double[] tristimulus)
      CIE-LAB -> RGB.
      static double[] LABtoXYZ(double l, double a, double b, double[] tristimulus)
      CIE-LAB -> XYZ.
      static double[] LCHtoLAB(double l, double c, double h)
      L*c*h -> CIE-L*A*B*
      static int[] LCHtoRGB(double l, double c, double h)
      L*c*h -> RGB.
      static int[] LMStoRGB(double[] lms)
      LMS -> RGB.
      static int[] LMStoRGB(double[] lms, ColorConverter.LMS matrix)
      LMS -> RGB.
      static int[] LMStoRGB(double l, double m, double s)
      LMS -> RGB.
      static int[] LMStoRGB(double l, double m, double s, ColorConverter.LMS matrix)
      LMS -> RGB.
      static double[] LMStoXYZ(double[] lms, ColorConverter.LMS matrix)
      LMS -> XYZ
      static double[] LMStoXYZ(double l, double m, double s, ColorConverter.LMS matrix)
      LMS -> XYZ
      static double[] RGBtoC1C2C3(Color color)
      RGB -> C1C2C3.
      static double[] RGBtoC1C2C3(int r, int g, int b)
      RGB -> C1C2C3.
      static double[] RGBtoCMYK(Color color)
      RGB -> CMYK
      static double[] RGBtoCMYK(int[] rgb)
      RGB -> CMYK
      static double[] RGBtoCMYK(int red, int green, int blue)
      RGB -> CMYK
      static double RGBtoGrayscale(Color color)
      RGB -> Grayscale.
      static double RGBtoGrayscale(int r, int g, int b)
      RGB -> Grayscale.
      static double[] RGBtoHSL(Color color)
      RGB -> HSL.
      static double[] RGBtoHSL(int red, int green, int blue)
      RGB -> HSL.
      static double[] RGBtoHSV(Color color)
      RGB -> HSV.
      static double[] RGBtoHSV(int red, int green, int blue)
      RGB -> HSV.
      static double[] RGBtoHunterLAB(Color color)
      RGB -> HunterLAB.
      static double[] RGBtoHunterLAB(int red, int green, int blue)
      RGB -> HunterLAB.
      static double[] RGBtoIHS(Color color)
      RGB -> IHS
      static double[] RGBtoIHS(int[] rgb)
      RGB -> IHS
      static double[] RGBtoIHS(int red, int green, int blue)
      RGB -> IHS
      static double[] RGBtoLAB(Color color, double[] tristimulus)
      RGB -> CIE-LAB.
      static double[] RGBtoLAB(int[] rgb) 
      static double[] RGBtoLAB(int[] rgb, double[] tristimulus) 
      static double[] RGBtoLAB(int red, int green, int blue)
      RGB -> CIE-LAB.
      static double[] RGBtoLAB(int red, int green, int blue, double[] tristimulus)
      RGB -> CIE-LAB.
      static double[] RGBtoLCH(Color color)
      RGB -> CIE L*C*h.
      static double[] RGBtoLCH(int red, int green, int blue)
      RGB -> CIE L*C*h.
      static double[] RGBtoLCH(int red, int green, int blue, double[] tristimulus)
      RGB -> CIE L*C*h.
      static double[] RGBtoLMS(int[] rgb)
      RGB -> LMS color space.
      static double[] RGBtoLMS(int[] rgb, ColorConverter.LMS matrix)
      RGB -> LMS color space.
      static double[] RGBtoLMS(int red, int green, int blue)
      RGB -> LMS color space.
      static double[] RGBtoLMS(int red, int green, int blue, ColorConverter.LMS matrix)
      RGB -> LMS color space.
      static double[] RGBtoO1O2(Color color)
      RGB -> O1O2.
      static double[] RGBtoO1O2(int r, int g, int b)
      RGB -> O1O2.
      static double[] RGBtoXYZ(Color color)
      RGB -> XYZ.
      static double[] RGBtoXYZ(int[] rgb)
      RGB -> XYZ.
      static double[] RGBtoXYZ(int red, int green, int blue)
      RGB -> XYZ.
      static double[] RGBtoYCbCr(Color color, ColorConverter.YCbCrColorSpace colorSpace) 
      static double[] RGBtoYCbCr(int red, int green, int blue, ColorConverter.YCbCrColorSpace colorSpace) 
      static double[] RGBtoYCC(Color color)
      RGB -> YCC.
      static double[] RGBtoYCC(int red, int green, int blue)
      RGB -> YCC.
      static double[] RGBtoYCoCg(Color color)
      RGB -> YCoCg.
      static double[] RGBtoYCoCg(int red, int green, int blue)
      RGB -> YCoCg.
      static double[] RGBtoYES(Color color)
      RGB -> YES.
      static double[] RGBtoYES(int[] rgb)
      RGB -> YES.
      static double[] RGBtoYES(int red, int green, int blue)
      RGB -> YES.
      static double[] RGBtoYIQ(Color color)
      RGB -> YIQ.
      static double[] RGBtoYIQ(int red, int green, int blue)
      RGB -> YIQ.
      static double[] RGBtoYUV(Color color)
      RGB -> YUV.
      static double[] RGBtoYUV(int red, int green, int blue)
      RGB -> YUV.
      static double[] RGChromaticity(Color color)
      Rg-Chromaticity space is already known to remove ambiguities due to illumination or surface pose.
      static double[] RGChromaticity(int red, int green, int blue)
      Rg-Chromaticity space is already known to remove ambiguities due to illumination or surface pose.
      static double[] XYYtoXYZ(double[] xyY)
      xyY to XYZ.
      static double[] XYYtoXYZ(double x, double y, double Y)
      xyY to XYZ.
      static double[] XYZtoHunterLAB(double x, double y, double z)
      XYZ -> HunterLAB
      static double[] XYZtoLAB(double[] xyz) 
      static double[] XYZtoLAB(double[] xyz, double[] tristimulus) 
      static double[] XYZtoLAB(double x, double y, double z, double[] tristimulus)
      XYZ -> CIE-LAB.
      static double[] XYZtoLMS(double[] xyz)
      XYZ -> LMS CIECAM02 transformation matrix default.
      static double[] XYZtoLMS(double[] xyz, ColorConverter.LMS matrix)
      XYZ -> LMS
      static double[] XYZtoLMS(double x, double y, double z)
      XYZ -> LMS CIECAM02 transformation matrix default.
      static double[] XYZtoLMS(double x, double y, double z, ColorConverter.LMS matrix)
      XYZ -> LMS
      static int[] XYZtoRGB(double[] xyz)
      XYZ -> RGB
      static int[] XYZtoRGB(double x, double y, double z)
      XYZ -> RGB
      static double[] XYZtoXyY(double[] xyz)
      XYZ to xyY color space.
      static double[] XYZtoXyY(double x, double y, double z)
      XYZ to xyY color space.
      static int[] YCbCrtoRGB(double y, double cb, double cr, ColorConverter.YCbCrColorSpace colorSpace) 
      static int[] YCCtoRGB(double y, double c1, double c2)
      YCC -> RGB.
      static int[] YCoCgtoRGB(double y, double co, double cg)
      YCoCg -> RGB.
      static int[] YEStoRGB(double[] yes)
      YES -> RGB
      static int[] YEStoRGB(double y, double e, double s)
      YES -> RGB
      static int[] YIQtoRGB(double y, double i, double q)
      YIQ -> RGB.
      static int[] YUVtoRGB(double y, double u, double v)
      YUV -> RGB.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • RGBtoCMYK

        public static double[] RGBtoCMYK(Color color)
        RGB -> CMYK
        Parameters:
        color - Color.
        Returns:
        CMYK color space. Normalized.
      • RGBtoCMYK

        public static double[] RGBtoCMYK(int[] rgb)
        RGB -> CMYK
        Parameters:
        rgb - RGB values.
        Returns:
        CMYK color space. Normalized.
      • RGBtoCMYK

        public static double[] RGBtoCMYK(int red,
                                         int green,
                                         int blue)
        RGB -> CMYK
        Parameters:
        red - Values in the range [0..255].
        green - Values in the range [0..255].
        blue - Values in the range [0..255].
        Returns:
        CMYK color space. Normalized.
      • CMYKtoRGB

        public static int[] CMYKtoRGB(double[] cmyk)
        CMYK -> RGB
        Parameters:
        cmyk - CMYK values.
        Returns:
        RGB color space.
      • CMYKtoRGB

        public static int[] CMYKtoRGB(double c,
                                      double m,
                                      double y,
                                      double k)
        CMYK -> RGB
        Parameters:
        c - Cyan.
        m - Magenta.
        y - Yellow.
        k - Black.
        Returns:
        RGB color space.
      • RGBtoIHS

        public static double[] RGBtoIHS(Color color)
        RGB -> IHS
        Parameters:
        color - Color.
        Returns:
        IHS color space. Normalized.
      • RGBtoIHS

        public static double[] RGBtoIHS(int[] rgb)
        RGB -> IHS
        Parameters:
        rgb - RGB values.
        Returns:
        RGB color space.
      • RGBtoIHS

        public static double[] RGBtoIHS(int red,
                                        int green,
                                        int blue)
        RGB -> IHS
        Parameters:
        red - Values in the range [0..255].
        green - Values in the range [0..255].
        blue - Values in the range [0..255].
        Returns:
        IHS color space. Normalized.
      • IHStoRGB

        public static double[] IHStoRGB(double[] ihs)
        IHS -> RGB
        Parameters:
        ihs - IHS vector.
        Returns:
        RGB color space.
      • RGBtoYUV

        public static double[] RGBtoYUV(Color color)
        RGB -> YUV.
        Parameters:
        color - Color.
        Returns:
        YUV color space.
      • RGBtoYUV

        public static double[] RGBtoYUV(int red,
                                        int green,
                                        int blue)
        RGB -> YUV. Y in the range [0..1]. U in the range [-0.5..0.5]. V in the range [-0.5..0.5].
        Parameters:
        red - Values in the range [0..255].
        green - Values in the range [0..255].
        blue - Values in the range [0..255].
        Returns:
        YUV color space.
      • YUVtoRGB

        public static int[] YUVtoRGB(double y,
                                     double u,
                                     double v)
        YUV -> RGB.
        Parameters:
        y - Luma. In the range [0..1].
        u - Chrominance. In the range [-0.5..0.5].
        v - Chrominance. In the range [-0.5..0.5].
        Returns:
        RGB color space.
      • RGBtoYIQ

        public static double[] RGBtoYIQ(Color color)
        RGB -> YIQ.
        Parameters:
        color - Color.
        Returns:
        YIQ color space.
      • RGBtoYIQ

        public static double[] RGBtoYIQ(int red,
                                        int green,
                                        int blue)
        RGB -> YIQ.
        Parameters:
        red - Values in the range [0..255].
        green - Values in the range [0..255].
        blue - Values in the range [0..255].
        Returns:
        YIQ color space.
      • YIQtoRGB

        public static int[] YIQtoRGB(double y,
                                     double i,
                                     double q)
        YIQ -> RGB.
        Parameters:
        y - Luma. Values in the range [0..1].
        i - In-phase. Values in the range [-0.5..0.5].
        q - Quadrature. Values in the range [-0.5..0.5].
        Returns:
        RGB color space.
      • RGChromaticity

        public static double[] RGChromaticity(Color color)
        Rg-Chromaticity space is already known to remove ambiguities due to illumination or surface pose.
        Parameters:
        color - Color.
        Returns:
        Normalized RGChromaticity. Range[0..1].
      • RGChromaticity

        public static double[] RGChromaticity(int red,
                                              int green,
                                              int blue)
        Rg-Chromaticity space is already known to remove ambiguities due to illumination or surface pose.
        Parameters:
        red - Red coefficient.
        green - Green coefficient.
        blue - Blue coefficient.
        Returns:
        Normalized RGChromaticity. Range[0..1].
        See Also:
        Information Processing - Chi Sing Leung. p. 668
      • RGBtoHSV

        public static double[] RGBtoHSV(Color color)
        RGB -> HSV. Adds (hue + 360) % 360 for represent hue in the range [0..359].
        Parameters:
        color - Color.
        Returns:
        HSV color space.
      • RGBtoHSV

        public static double[] RGBtoHSV(int red,
                                        int green,
                                        int blue)
        RGB -> HSV. Adds (hue + 360) % 360 for represent hue in the range [0..359].
        Parameters:
        red - Red coefficient. Values in the range [0..255].
        green - Green coefficient. Values in the range [0..255].
        blue - Blue coefficient. Values in the range [0..255].
        Returns:
        HSV color space.
      • HSVtoRGB

        public static int[] HSVtoRGB(double hue,
                                     double saturation,
                                     double value)
        HSV -> RGB.
        Parameters:
        hue - Hue.
        saturation - Saturation. In the range[0..1].
        value - Value. In the range[0..1].
        Returns:
        RGB color space. In the range[0..255].
      • RGBtoYCC

        public static double[] RGBtoYCC(Color color)
        RGB -> YCC.
        Parameters:
        color - Color.
        Returns:
        YCC color space. In the range [0..1].
      • RGBtoYCC

        public static double[] RGBtoYCC(int red,
                                        int green,
                                        int blue)
        RGB -> YCC.
        Parameters:
        red - Red coefficient. Values in the range [0..255].
        green - Green coefficient. Values in the range [0..255].
        blue - Blue coefficient. Values in the range [0..255].
        Returns:
        YCC color space. In the range [0..1].
      • YCCtoRGB

        public static int[] YCCtoRGB(double y,
                                     double c1,
                                     double c2)
        YCC -> RGB.
        Parameters:
        y - Y coefficient.
        c1 - C coefficient.
        c2 - C coefficient.
        Returns:
        RGB color space.
      • RGBtoYCoCg

        public static double[] RGBtoYCoCg(Color color)
        RGB -> YCoCg.
        Parameters:
        color - Color.
        Returns:
        YCoCg color space.
      • RGBtoYCoCg

        public static double[] RGBtoYCoCg(int red,
                                          int green,
                                          int blue)
        RGB -> YCoCg.
        Parameters:
        red - Red coefficient. Values in the range [0..255].
        green - Green coefficient. Values in the range [0..255].
        blue - Blue coefficient. Values in the range [0..255].
        Returns:
        YCoCg color space.
      • RGBtoYES

        public static double[] RGBtoYES(Color color)
        RGB -> YES.
        Parameters:
        color - Color.
        Returns:
        YES color space.
      • RGBtoYES

        public static double[] RGBtoYES(int[] rgb)
        RGB -> YES.
        Parameters:
        rgb - RGB values.
        Returns:
        YES color space.
      • RGBtoYES

        public static double[] RGBtoYES(int red,
                                        int green,
                                        int blue)
        RGB -> YES.
        Parameters:
        red - Red coefficient. Values in the range [0..255].
        green - Green coefficient. Values in the range [0..255].
        blue - Blue coefficient. Values in the range [0..255].
        Returns:
        YES color space.
      • YEStoRGB

        public static int[] YEStoRGB(double[] yes)
        YES -> RGB
        Parameters:
        yes - YES color space.
        Returns:
        RGB color space.
      • YEStoRGB

        public static int[] YEStoRGB(double y,
                                     double e,
                                     double s)
        YES -> RGB
        Parameters:
        y - Luminance component. [0..1]
        e - Chrominance factor. Difference of red and green channels. [-0.5..0.5]
        s - Chrominance factor. Difference of yellow and blue. [-0.5..0.5]
        Returns:
        RGB color space.
      • YCoCgtoRGB

        public static int[] YCoCgtoRGB(double y,
                                       double co,
                                       double cg)
        YCoCg -> RGB.
        Parameters:
        y - Pseudo luminance, or intensity.
        co - Orange chrominance.
        cg - Green chrominance.
        Returns:
        RGB color space.
      • RGBtoXYZ

        public static double[] RGBtoXYZ(Color color)
        RGB -> XYZ.
        Parameters:
        color - Color.
        Returns:
        XYZ color space.
      • RGBtoXYZ

        public static double[] RGBtoXYZ(int red,
                                        int green,
                                        int blue)
        RGB -> XYZ.
        Parameters:
        red - Red coefficient. Values in the range [0..255].
        green - Green coefficient. Values in the range [0..255].
        blue - Blue coefficient. Values in the range [0..255].
        Returns:
        XYZ color space.
      • RGBtoXYZ

        public static double[] RGBtoXYZ(int[] rgb)
        RGB -> XYZ.
        Parameters:
        rgb - sRGB color space.
        Returns:
        XYZ color space.
      • XYZtoRGB

        public static int[] XYZtoRGB(double x,
                                     double y,
                                     double z)
        XYZ -> RGB
        Parameters:
        x - X coefficient.
        y - Y coefficient.
        z - Z coefficient.
        Returns:
        RGB color space.
      • XYZtoRGB

        public static int[] XYZtoRGB(double[] xyz)
        XYZ -> RGB
        Parameters:
        xyz - XYZ color space.
        Returns:
        sRGB color space.
      • XYZtoXyY

        public static double[] XYZtoXyY(double x,
                                        double y,
                                        double z)
        XYZ to xyY color space.
        Parameters:
        x - X coordinate.
        y - Y coordinate.
        z - Z coordinate.
        Returns:
        xyY color space.
      • XYZtoXyY

        public static double[] XYZtoXyY(double[] xyz)
        XYZ to xyY color space.
        Parameters:
        xyz - XYZ color space.
        Returns:
        xyY color space.
      • XYZtoHunterLAB

        public static double[] XYZtoHunterLAB(double x,
                                              double y,
                                              double z)
        XYZ -> HunterLAB
        Parameters:
        x - X coefficient.
        y - Y coefficient.
        z - Z coefficient.
        Returns:
        HunterLab coefficient.
      • XYZtoLMS

        public static double[] XYZtoLMS(double x,
                                        double y,
                                        double z)
        XYZ -> LMS CIECAM02 transformation matrix default.
        Parameters:
        x - X coordinate.
        y - Y coordinate.
        z - Z coordinate.
        Returns:
        LMS color space.
      • XYZtoLMS

        public static double[] XYZtoLMS(double x,
                                        double y,
                                        double z,
                                        ColorConverter.LMS matrix)
        XYZ -> LMS
        Parameters:
        x - X coordinate.
        y - Y coordinate.
        z - Z coordinate.
        matrix - LMS transformation matrix.
        Returns:
        LMS color space.
      • XYZtoLMS

        public static double[] XYZtoLMS(double[] xyz)
        XYZ -> LMS CIECAM02 transformation matrix default.
        Parameters:
        xyz - XYZ Color space.
        Returns:
        LMS color space.
      • XYZtoLMS

        public static double[] XYZtoLMS(double[] xyz,
                                        ColorConverter.LMS matrix)
        XYZ -> LMS
        Parameters:
        xyz - XYZ color space.
        matrix - LMS transformation matrix.
        Returns:
        LMS color space.
      • XYYtoXYZ

        public static double[] XYYtoXYZ(double x,
                                        double y,
                                        double Y)
        xyY to XYZ.
        Parameters:
        x - X coordinate.
        y - Y coordinate.
        Y - Z coordinate.
        Returns:
        XYZ color space.
      • XYYtoXYZ

        public static double[] XYYtoXYZ(double[] xyY)
        xyY to XYZ.
        Parameters:
        xyY - color space..
        Returns:
        XYZ color space.
      • HunterLABtoXYZ

        public static double[] HunterLABtoXYZ(double l,
                                              double a,
                                              double b)
        HunterLAB -> XYZ
        Parameters:
        l - L coefficient.
        a - A coefficient.
        b - B coefficient.
        Returns:
        XYZ color space.
      • RGBtoHunterLAB

        public static double[] RGBtoHunterLAB(Color color)
        RGB -> HunterLAB.
        Parameters:
        color - Color.
        Returns:
        HunterLAB color space.
      • RGBtoHunterLAB

        public static double[] RGBtoHunterLAB(int red,
                                              int green,
                                              int blue)
        RGB -> HunterLAB.
        Parameters:
        red - Red coefficient. Values in the range [0..255].
        green - Green coefficient. Values in the range [0..255].
        blue - Blue coefficient. Values in the range [0..255].
        Returns:
        HunterLAB color space.
      • HunterLABtoRGB

        public static int[] HunterLABtoRGB(double l,
                                           double a,
                                           double b)
        HunterLAB -> RGB.
        Parameters:
        l - L coefficient.
        a - A coefficient.
        b - B coefficient.
        Returns:
        RGB color space.
      • RGBtoHSL

        public static double[] RGBtoHSL(Color color)
        RGB -> HSL.
        Parameters:
        color - Color.
        Returns:
        HLS color space.
      • RGBtoHSL

        public static double[] RGBtoHSL(int red,
                                        int green,
                                        int blue)
        RGB -> HSL.
        Parameters:
        red - Red coefficient. Values in the range [0..255].
        green - Green coefficient. Values in the range [0..255].
        blue - Blue coefficient. Values in the range [0..255].
        Returns:
        HLS color space.
      • HSLtoRGB

        public static int[] HSLtoRGB(double hue,
                                     double saturation,
                                     double luminance)
        HLS -> RGB.
        Parameters:
        hue - Hue.
        saturation - Saturation.
        luminance - Luminance.
        Returns:
        RGB color space.
      • RGBtoLAB

        public static double[] RGBtoLAB(int[] rgb)
      • RGBtoLAB

        public static double[] RGBtoLAB(int[] rgb,
                                        double[] tristimulus)
      • RGBtoLAB

        public static double[] RGBtoLAB(Color color,
                                        double[] tristimulus)
        RGB -> CIE-LAB.
        Parameters:
        color - Color.
        tristimulus - XYZ Tristimulus.
        Returns:
        CIE-LAB color space.
      • RGBtoLAB

        public static double[] RGBtoLAB(int red,
                                        int green,
                                        int blue)
        RGB -> CIE-LAB. Default: CIE 2o D65 Tristimulus.
        Parameters:
        red - Red coefficient. Values in the range [0..255].
        green - Green coefficient. Values in the range [0..255].
        blue - Blue coefficient. Values in the range [0..255].
        Returns:
        CIE-L*A*B* color space.
      • RGBtoLAB

        public static double[] RGBtoLAB(int red,
                                        int green,
                                        int blue,
                                        double[] tristimulus)
        RGB -> CIE-LAB.
        Parameters:
        red - Red coefficient. Values in the range [0..255].
        green - Green coefficient. Values in the range [0..255].
        blue - Blue coefficient. Values in the range [0..255].
        tristimulus - XYZ Tristimulus.
        Returns:
        CIE-LAB color space.
      • RGBtoLCH

        public static double[] RGBtoLCH(Color color)
        RGB -> CIE L*C*h.
        Parameters:
        color - Color.
        Returns:
        CIE-L*c*h color space.
      • RGBtoLCH

        public static double[] RGBtoLCH(int red,
                                        int green,
                                        int blue)
        RGB -> CIE L*C*h.
        Parameters:
        red - Red coefficient. Values in the range [0..255].
        green - Green coefficient. Values in the range [0..255].
        blue - Blue coefficient. Values in the range [0..255].
        Returns:
        CIE L*C*h color space.
      • RGBtoLCH

        public static double[] RGBtoLCH(int red,
                                        int green,
                                        int blue,
                                        double[] tristimulus)
        RGB -> CIE L*C*h.
        Parameters:
        red - Red coefficient. Values in the range [0..255].
        green - Green coefficient. Values in the range [0..255].
        blue - Blue coefficient. Values in the range [0..255].
        tristimulus - XYZ Tristimulus.
        Returns:
        L*c*h color space.
      • RGBtoLMS

        public static double[] RGBtoLMS(int red,
                                        int green,
                                        int blue)
        RGB -> LMS color space. CIECAM02 transformation matrix default.
        Parameters:
        red - Red coefficient. Values in the range [0..255].
        green - Green coefficient. Values in the range [0..255].
        blue - Blue coefficient. Values in the range [0..255].
        Returns:
        LMS color space.
      • RGBtoLMS

        public static double[] RGBtoLMS(int red,
                                        int green,
                                        int blue,
                                        ColorConverter.LMS matrix)
        RGB -> LMS color space.
        Parameters:
        red - Red coefficient. Values in the range [0..255].
        green - Green coefficient. Values in the range [0..255].
        blue - Blue coefficient. Values in the range [0..255].
        matrix - LMS matrix.
        Returns:
        LMS color space.
      • RGBtoLMS

        public static double[] RGBtoLMS(int[] rgb)
        RGB -> LMS color space. CIECAM02 transformation matrix default.
        Parameters:
        rgb - sRGB color space.
        Returns:
        LMS color space.
      • RGBtoLMS

        public static double[] RGBtoLMS(int[] rgb,
                                        ColorConverter.LMS matrix)
        RGB -> LMS color space.
        Parameters:
        rgb - sRGB color space.
        matrix - LMS matrix.
        Returns:
        LMS color space.
      • LABtoRGB

        public static int[] LABtoRGB(double[] lab)
        CIE-L*A*B* to RGB.
        Parameters:
        lab - L*A*B* color space.
        Returns:
        RGB color space.
      • LABtoRGB

        public static int[] LABtoRGB(double[] lab,
                                     double[] tristimulus)
        CIE-L*A*B* to RGB.
        Parameters:
        lab - L*A*B* color space.
        tristimulus - XYZ Tristimulus.
        Returns:
        RGB color space.
      • LABtoRGB

        public static int[] LABtoRGB(double l,
                                     double a,
                                     double b)
        CIE-L*A*B* to RGB.
        Parameters:
        l - L coefficient.
        a - a* coefficient.
        b - b* coefficient.
        Returns:
        RGB color space.
      • LABtoRGB

        public static int[] LABtoRGB(double l,
                                     double a,
                                     double b,
                                     double[] tristimulus)
        CIE-LAB -> RGB.
        Parameters:
        l - L coefficient.
        a - A coefficient.
        b - B coefficient.
        tristimulus - XYZ Tristimulus.
        Returns:
        RGB color space.
      • LABtoLCH

        public static double[] LABtoLCH(double[] lab)
        CIE-L*A*B* -> L*C*h
        Parameters:
        lab - CIE-L*A*B* color space.
        Returns:
        L*C*h color space.
      • LABtoLCH

        public static double[] LABtoLCH(double l,
                                        double a,
                                        double b)
        CIE-L*A*B* -> L*c*h
        Parameters:
        l - L coefficient.
        a - A coefficient.
        b - B coefficient.
        Returns:
        L*h*c color space.
      • LMStoRGB

        public static int[] LMStoRGB(double l,
                                     double m,
                                     double s)
        LMS -> RGB.
        Parameters:
        l - Long wavelength.
        m - Medium wavelength.
        s - Short wavelength.
        Returns:
        sRGB color space.
      • LMStoRGB

        public static int[] LMStoRGB(double l,
                                     double m,
                                     double s,
                                     ColorConverter.LMS matrix)
        LMS -> RGB.
        Parameters:
        l - Long wavelength.
        m - Medium wavelength.
        s - Short wavelength.
        matrix - LMS transformation matrix.
        Returns:
        sRGB color space.
      • LMStoRGB

        public static int[] LMStoRGB(double[] lms)
        LMS -> RGB.
        Parameters:
        lms - LMS color space.
        Returns:
        sRGB color space.
      • LMStoRGB

        public static int[] LMStoRGB(double[] lms,
                                     ColorConverter.LMS matrix)
        LMS -> RGB.
        Parameters:
        lms - LMS color space.
        matrix - LMS transformation matrix.
        Returns:
        sRGB color space.
      • XYZtoLAB

        public static double[] XYZtoLAB(double[] xyz)
      • XYZtoLAB

        public static double[] XYZtoLAB(double[] xyz,
                                        double[] tristimulus)
      • XYZtoLAB

        public static double[] XYZtoLAB(double x,
                                        double y,
                                        double z,
                                        double[] tristimulus)
        XYZ -> CIE-LAB.
        Parameters:
        x - X coefficient.
        y - Y coefficient.
        z - Z coefficient.
        tristimulus - XYZ Tristimulus.
        Returns:
        CIE-LAB color space.
      • LABtoXYZ

        public static double[] LABtoXYZ(double l,
                                        double a,
                                        double b,
                                        double[] tristimulus)
        CIE-LAB -> XYZ.
        Parameters:
        l - L coefficient.
        a - A coefficient.
        b - B coefficient.
        tristimulus - XYZ Tristimulus.
        Returns:
        XYZ color space.
      • LCHtoLAB

        public static double[] LCHtoLAB(double l,
                                        double c,
                                        double h)
        L*c*h -> CIE-L*A*B*
        Parameters:
        l - L coefficient.
        c - *c coefficient.
        h - *h coefficient.
        Returns:
        CIE-L*A*B* color space.
      • LCHtoRGB

        public static int[] LCHtoRGB(double l,
                                     double c,
                                     double h)
        L*c*h -> RGB.
        Parameters:
        l - L coefficient.
        c - *c coefficient.
        h - *h coefficient.
        Returns:
        RGB color space.
      • LMStoXYZ

        public static double[] LMStoXYZ(double l,
                                        double m,
                                        double s,
                                        ColorConverter.LMS matrix)
        LMS -> XYZ
        Parameters:
        l - Long wavelengths.
        m - Medium wavelengths.
        s - Short wavelengths.
        matrix - Transformation matrix.
        Returns:
        XYZ color space.
      • LMStoXYZ

        public static double[] LMStoXYZ(double[] lms,
                                        ColorConverter.LMS matrix)
        LMS -> XYZ
        Parameters:
        lms - LMS color space.
        matrix - Transformation matrix.
        Returns:
        XYZ color space.
      • RGBtoC1C2C3

        public static double[] RGBtoC1C2C3(Color color)
        RGB -> C1C2C3.
        Parameters:
        color - Color.
        Returns:
        C1C2C3 color space.
      • RGBtoC1C2C3

        public static double[] RGBtoC1C2C3(int r,
                                           int g,
                                           int b)
        RGB -> C1C2C3.
        Parameters:
        r - Red coefficient. Values in the range [0..255].
        g - Green coefficient. Values in the range [0..255].
        b - Blue coefficient. Values in the range [0..255].
        Returns:
        C1C2C3 color space.
      • RGBtoO1O2

        public static double[] RGBtoO1O2(Color color)
        RGB -> O1O2.
        Parameters:
        color - Color.
        Returns:
        O1O2 color space.
      • RGBtoO1O2

        public static double[] RGBtoO1O2(int r,
                                         int g,
                                         int b)
        RGB -> O1O2.
        Parameters:
        r - Red coefficient. Values in the range [0..255].
        g - Green coefficient. Values in the range [0..255].
        b - Blue coefficient. Values in the range [0..255].
        Returns:
        O1O2 color space.
      • RGBtoGrayscale

        public static double RGBtoGrayscale(Color color)
        RGB -> Grayscale.
        Parameters:
        color - Color.
        Returns:
        Grayscale color space.
      • RGBtoGrayscale

        public static double RGBtoGrayscale(int r,
                                            int g,
                                            int b)
        RGB -> Grayscale.
        Parameters:
        r - Red coefficient. Values in the range [0..255].
        g - Green coefficient. Values in the range [0..255].
        b - Blue coefficient. Values in the range [0..255].
        Returns:
        Grayscale color space.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.