I am experimenting with LCMS (thank you for creating it and making it
available) and have some results which I don't understand.
I created a synthetic image of an IT8.7 target, and measured it using
qtmeasurementtool. I then wrote code using the LCMS library to
convert these sRGB values to XYZ and L*a*b* and created an IT8.7 "data
sheet". Finally, I used these two files with qtscannerprofiler to
create a profile, and tested the profile on the original image using
tifficc.
I had expected the profile to have a zero average dE (the sRGB and
XYZ and L*a*b* values exactly matched) and the output of tifficc to be
identical to the originial image. Instead, qtscannerprofiler had very
large dE values, and the tifficc output was almost entirely white (out
of gamut overflow?).
Following are details from the data and code. Any advice is welcome.
A typical entry from the qtmeasurementtool output file:
B6 200 79 73 0
Part of the header and the corresponding entry from the "data
file". These values match the results of using icctrans manually.
SAMPLE_ID XYZ_X XYZ_Y XYZ_Z LAB_L LAB_A LAB_B
B6 29.14 18.85 6.32 50.52 48.83 29.74
Excerpts from the code used to translate sRGB to XYZ and L*a*b*:
cmsHPROFILE srgb_icc = cmsCreate_sRGBProfile(),
xyz_icc = cmsCreateXYZProfile (),
lab_icc = cmsCreateLabProfile (NULL) ;
icColorSpaceSignature srgb_space = cmsGetColorSpace(srgb_icc) ;
DWORD dw_srgb = BYTES_SH(2) |
CHANNELS_SH(_cmsChannelsOf(srgb_space)) ;
cmsHTRANSFORM
xyz_trans = cmsCreateTransform(srgb_icc,
dw_srgb,
xyz_icc,
TYPE_XYZ_16,
INTENT_RELATIVE_COLORIMETRIC,
cmsFLAGS_NOTPRECALC),
lab_trans = cmsCreateTransform(srgb_icc,
dw_srgb,
lab_icc,
TYPE_Lab_16,
INTENT_RELATIVE_COLORIMETRIC,
cmsFLAGS_NOTPRECALC) ;
WORD rgb[MAXCHANNELS],
xyz[MAXCHANNELS],
lab[MAXCHANNELS] ;
sscanf(buffer + blank, "%d%d%d", rgb, rgb+1, rgb+2) ;
rgb[0] *= 257 ;
rgb[1] *= 257 ;
rgb[2] *= 257 ;
cmsDoTransform(xyz_trans, rgb, xyz, 1) ;
cmsDoTransform(lab_trans, rgb, lab, 1) ;
cmsCIEXYZ xyz_float ;
cmsCIELab lab_float ;
cmsXYZEncoded2Float(&xyz_float, xyz) ;
cmsLabEncoded2Float(&lab_float, lab) ;
fprintf(output,
"%-4.*s %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f\n",
blank,
buffer,
xyz_float.X * 100.0,
xyz_float.Y * 100.0,
xyz_float.Z * 100.0,
lab_float.L,
lab_float.a,
lab_float.b) ;
The errors from qtscannerprofiler:
Average dE : 69.72
Standard deviation : 26.90
Peak : 127.33
Min : 0.00
I also tried using INTENT_PERCEPTUAL in the cmsCreateTransform(...)
calls, which gave the same XYZ and L*a*b* values as
INTENT_RELATIVE_COLORIMETRIC. Using INTENT_ABSOLUTE_COLORIMETRIC
gave different values, but similar bad results:
Average dE : 70.36
Standard deviation : 26.86
Peak : 131.91
Min : 0.00
=====
--
MARK
[EMAIL PROTECTED]
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
Lcms-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/lcms-user