EVALUATION
Inaccuracy in sRGB color space mostly was caused by usage of the obsolete sRGB ICC profile that based on the lookup tables. Updating this profile with new one (based on tonal response curves) greatly improves precision of the color transformation. Also, to avoid unnecessary conversion (like we have in attached testcase) we are going to create fast track for ColorConverOps that consist of color spaces equal to the source and destination ones. So, there will be no color transforms just transfer of pixels.
|
EVALUATION
This problem could is not only related to the images. It's also could be illustrated using more simple test:
...
ColorSpace srcColorSpace = ColorSpace.getInstance(ColorSpace.CS_sRGB);
System.out.println("Color.RED components " + Color.RED.getRed() +
", " + Color.RED.getGreen() + ", " +
Color.RED.getBlue());
float [] red = Color.RED.getColorComponents(srcColorSpace, null);
Color newRed = new Color(srcColorSpace, red, 1.0f);
System.out.println("Color.RED components " + newRed.getRed() +
", " + newRed.getGreen() + ", " +
newRed.getBlue());
...
Result:
Color.RED components 255, 0, 0
Color.RED components 249, 0, 5
This happens because of errors in convertations between float and internal color representation of our CMM
library.
|