Brixomatic commented on a change in pull request #114:
URL: https://github.com/apache/commons-imaging/pull/114#discussion_r548922651



##########
File path: src/main/java/org/apache/commons/imaging/color/ColorConversions.java
##########
@@ -132,33 +123,31 @@ public static int convertXYZtoRGB(final double X, final 
double Y, final double Z
         final double var_Y = Y / 100.0; // Where Y = 0 ÷ 100.000
         final double var_Z = Z / 100.0; // Where Z = 0 ÷ 108.883
 
-        double var_R = var_X * 3.2406 + var_Y * -1.5372 + var_Z * -0.4986;
-        double var_G = var_X * -0.9689 + var_Y * 1.8758 + var_Z * 0.0415;
-        double var_B = var_X * 0.0557 + var_Y * -0.2040 + var_Z * 1.0570;
+        // see: 
https://github.com/StanfordHCI/c3/blob/master/java/src/edu/stanford/vis/color/LAB.java
+        double var_R = var_X * 3.2404542 + var_Y * -1.5371385 + var_Z * 
-0.4985314;
+        double var_G = var_X * -0.9692660 + var_Y * 1.8760108 + var_Z * 
0.0415560;
+        double var_B = var_X * 0.0556434 + var_Y * -0.2040259 + var_Z * 
1.0572252;

Review comment:
       Using more precise numbers. This made some small, but noticeable 
difference in tests.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to