Hi,

I'm new to lcms and icc profiles, so please apologize should this be a silly question: I'm trying to write a little application that produces ICC profiles for the simulation of color blindness (deuteranopia and protanopia). An algorithm for the simulation can be found here: http:// vision.psychol.cam.ac.uk/jdmollon/papers/colourmaps.pdf The algorithm basically converts from XYZ to LMS color space, does some manipulation in LMS, and converts back to XYZ (and then to RGB). The manipulations in LMS space can be expressed by a 3x3 matrix.

I tried to generate a display profile with the code below, but had no success applying the profile on Mac OS X. I can see two problems: 1. The values of the conversion matrix: Is it correct that the "input" for a display profile's conversion matrix is XYZ in the range of 0 to 1? and the "output" of the matrix linear RGB also in the range of 0 to 1? 2. The whole conversion matrix from XYZ to linear RGB (with the assumption of question 1) is for protanopia :
-0.516332807   1.520442693   -0.031705228
-0.516338142   1.520458403   -0.031703226
0.075410228   -0.222060129   1.100680409
Should I use these values to set the rXYZ, gXYZ, and bXYZ tags of the profile?

Do you see any problem with such a special color profile?

Thank you for any help.

Bernhard Jenny
Institute of Cartography, ETH Zurich

double mat[9];
mat[0] = -0.516332807; mat[3] = 1.520442693; mat[6] = -0.031705228; mat[1] = -0.516338142; mat[4] = 1.520458403; mat[7] = -0.031703226; mat[2] = 0.075410228; mat[5] = -0.222060129; mat[8] = 1.100680409;

cmsHPROFILE hProfile = _cmsCreateProfilePlaceholder();
if (!hProfile) return -1;
cmsSetDeviceClass(hProfile, icSigDisplayClass);
cmsSetColorSpace(hProfile, icSigRgbData);
cmsSetPCS(hProfile, icSigXYZData);
cmsSetRenderingIntent(hProfile, INTENT_PERCEPTUAL);
cmsSetHeaderFlags(hProfile, 0);

cmsAddTag(hProfile, icSigRedColorantTag, &mat[0]);
cmsAddTag(hProfile, icSigGreenColorantTag, &mat[3]);
cmsAddTag(hProfile, icSigBlueColorantTag, &mat[6]);
cmsAddTag(hProfile, icSigMediaWhitePointTag,(LPVOID) cmsD50_XYZ() );

// gamma
LPGAMMATABLE gamma = cmsBuildGamma(64, 1.8);
cmsAddTag(hProfile, icSigRedTRCTag, gamma);
cmsAddTag(hProfile, icSigGreenTRCTag, gamma);
cmsAddTag(hProfile, icSigBlueTRCTag, gamma);
cmsFreeGamma(gamma);

cmsAddTag(hProfile, icSigProfileDescriptionTag, (LPVOID) profileName);
cmsAddTag(hProfile, icSigCopyrightTag, (LPVOID) copyright);

// Save profile and clean-up
_cmsSaveProfile(hProfile, path);
cmsCloseProfile(hProfile);




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to