Class CieUtils

java.lang.Object
imagingbook.common.color.cie.CieUtils

public abstract class CieUtils extends Object

Defines static methods for converting between CIE-XYZ coordinates (3D) and xy chromaticity values (2D). See Sec. 14.1.2 of [1] for details.

[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).

  • Method Details

    • xyToXYZ

      public static double[] xyToXYZ(double x, double y)
      Calculates the XYZ coordinates for a given point (x,y) in the CIE xy-color diagram. XYZ is located on the 3D plane X + Y + Z = 1. Returns (0,0,0) for y = 0;
      Parameters:
      x - x-coordinate (in the 2D xy-diagram)
      y - y-coordinate (in the 2D xy-diagram)
      Returns:
      the associated XYZ coordinate
    • xyToXYZ

      public static float[] xyToXYZ(float x, float y)
      Float version of xyToXYZ(double, double).
      Parameters:
      x - x-coordinate (in the 2D xy-diagram)
      y - y-coordinate (in the 2D xy-diagram)
      Returns:
      the associated XYZ coordinate
    • xyYToXYZ

      public static double[] xyYToXYZ(double x, double y, double Y)
      Calculates the XYZ coordinates for a given point (x,y) in the CIE xy-color diagram, with Y explicitly specified.
      Parameters:
      x - x-coordinate (in the 2D xy-diagram)
      y - y-coordinate (in the 2D xy-diagram)
      Y - the Y-coordinate (in 3D color space)
      Returns:
      the associated XYZ coordinate
    • xyYToXYZ

      public static float[] xyYToXYZ(float x, float y, float Y)
      Parameters:
      x - x-coordinate (in the 2D xy-diagram)
      y - y-coordinate (in the 2D xy-diagram)
      Y - the Y-coordinate (in 3D color space)
      Returns:
      the associated XYZ coordinate
    • XYZToxy

      public static double[] XYZToxy(double[] XYZ)
      Calculates the 2D (x,y) color diagram coordinates for 3D XYZ color coordinates (X,Y,Z).
      Parameters:
      XYZ - the XYZ coordinate (3D)
      Returns:
      the xy-coordinate (2D)
    • XYZToxyz

      public static double[] XYZToxyz(double[] XYZ)
      Calculates the 3D (x,y,z) color diagram coordinates for 3D XYZ color coordinates (X,Y,Z).
      Parameters:
      XYZ - the XYZ coordinate (3D)
      Returns:
      the xyz-coordinate (3D)
    • XYZToxy

      public static float[] XYZToxy(float[] XYZ)
      Float version of XYZToxy(double[]).
      Parameters:
      XYZ - the XYZ coordinate (3D)
      Returns:
      the xy-coordinate (2D)
    • XYZToxyz

      public static float[] XYZToxyz(float[] XYZ)
      Float version of XYZToxyz(double[]).
      Parameters:
      XYZ - the XYZ coordinate (3D)
      Returns:
      the xyz-coordinate (§D)