RFR: 8288633: The ICC_ColorSpace.fromCIEXYZ method uses the wrong rendering intent

Sergey Bylokhov serb at openjdk.org
Fri Jun 17 03:36:43 UTC 2022


The specification of the  ICC_ColorSpace.fromCIEXYZ method [says](https://urldefense.com/v3/__https://github.com/openjdk/jdk/blob/9d4b25e7888098a866ff980e37b8d16d456906d8/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java*L428__;Iw!!ACWV5N9M2RV99hQ!NAAdRno23xze0ZEWsbb6vcPyhq3uSLQLn75UMmiM--6Np4w3HL7ZObrqG4JR_33oVwNueSb1CcnE78vZi2YAcw$ ):

> * This method transforms color values using relative colorimetry, as defined by the ICC Specification.

The LCMS plugin implementation expects the rendering intent in the first part of transform:
https://urldefense.com/v3/__https://github.com/openjdk/jdk/blob/9d4b25e7888098a866ff980e37b8d16d456906d8/src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMSTransform.java*L116__;Iw!!ACWV5N9M2RV99hQ!NAAdRno23xze0ZEWsbb6vcPyhq3uSLQLn75UMmiM--6Np4w3HL7ZObrqG4JR_33oVwNueSb1CcnE78tHGfZENw$ 

But the ICC_ColorSpace.fromCIEXYZ pass "ICC_Profile.icRelativeColorimetric" to the [second ](https://urldefense.com/v3/__https://github.com/openjdk/jdk/blob/9d4b25e7888098a866ff980e37b8d16d456906d8/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java*L534__;Iw!!ACWV5N9M2RV99hQ!NAAdRno23xze0ZEWsbb6vcPyhq3uSLQLn75UMmiM--6Np4w3HL7ZObrqG4JR_33oVwNueSb1CcnE78s0xPRGZQ$ ) part of transform. 

Note that ICC_ColorSpace.toCIEXYZ has a similar [specification ](https://urldefense.com/v3/__https://github.com/openjdk/jdk/blob/9d4b25e7888098a866ff980e37b8d16d456906d8/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java*L288)is__;Iw!!ACWV5N9M2RV99hQ!NAAdRno23xze0ZEWsbb6vcPyhq3uSLQLn75UMmiM--6Np4w3HL7ZObrqG4JR_33oVwNueSb1CcnE78v2XGbsLw$  implemented [properly](https://urldefense.com/v3/__https://github.com/openjdk/jdk/blob/9d4b25e7888098a866ff980e37b8d16d456906d8/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java*L391__;Iw!!ACWV5N9M2RV99hQ!NAAdRno23xze0ZEWsbb6vcPyhq3uSLQLn75UMmiM--6Np4w3HL7ZObrqG4JR_33oVwNueSb1CcnE78vH5MMpLg$ ).

-------------

Commit messages:
 - Update ICC_ColorSpace.java
 - 8288633: The ICC_ColorSpace.fromCIEXYZ method uses the wrong rendering intent

Changes: https://git.openjdk.org/jdk/pull/9194/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9194&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8288633
  Stats: 102 lines in 2 files changed: 95 ins; 2 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/9194.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9194/head:pull/9194

PR: https://git.openjdk.org/jdk/pull/9194



More information about the client-libs-dev mailing list