Marti,

I'm trying to convert from print viewing conditions to sRGB conditions
using the lcms CIECAM97s routines (see code below).

And I'm surprised that the reverse conversion of
JCh=[5.492917,55.960811,271.605300] results in XYZ=[0,0,0], which does
not seem to be plausible.

    xyz=[0.735832 0.378688 3.452046] =>
    JCh=[5.492917 55.960811 271.605300] =>
    xyz=[0.000000 0.000000 0.000000]

If I use the CIECAM02 routines instead of 97s, then I do get plausible
results:

    xyz=[0.735832 0.378688 3.452046] =>
    JCh=[4.663790 36.817060 260.052607] =>
    xyz=[0.448270 0.186863 2.299115]


With the CIECAM02 routines there seems to be another problem though: It
looks like the "D" factor is always computed, even if I explicitly
specify a D_value of e.g. 1.0 (which is != D_CALCULATE). The CIECAM97s
routines on the other hand do honor a user spplied D_value. In some
cases it is IMO useful to override the degree of adaptation and to
assume complete adaptation. So I'd appreciate if the CIECAM02 routines
would support a user supplied D_value too.

Regards,
Gerhard

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

    int main(int ac, char **av)
    {
        cmsJCh JCh;
        cmsCIELab Lab;
        cmsCIEXYZ xyz;
        cmsViewingConditions svc, dvc;
        LCMSHANDLE hsrc, hdst;

        svc.whitePoint.X = 100*D50X;
        svc.whitePoint.Y = 100*D50Y;
        svc.whitePoint.Z = 100*D50Z;
        svc.Yb = 20;
        svc.La = 32;
        svc.surround = AVG_SURROUND;
        svc.D_value = 1.0;

        dvc.whitePoint.X = 95.05;
        dvc.whitePoint.Y = 100.0;
        dvc.whitePoint.Z = 108.91;
        dvc.Yb = 20;
        dvc.La = 4;
        dvc.surround = DIM_SURROUND;
        dvc.D_value = 1.0;

        /* a dark blue color */
        Lab.L = 3.420672;
        Lab.a = 14.969221;
        Lab.b = -35.952678;
        cmsLab2XYZ(NULL, &xyz, &Lab);
        xyz.X *= 100; xyz.Y *= 100; xyz.Z *= 100;

        hsrc = cmsCIECAM97sInit(&svc);
        hdst = cmsCIECAM97sInit(&dvc);
        printf("xyz=[%f %f %f]\n", xyz.X, xyz.Y, xyz.Z);
        cmsCIECAM97sForward(hsrc, &xyz, &JCh);
        printf("JCh=[%f %f %f]\n", JCh.J, JCh.C, JCh.h);
        cmsCIECAM97sReverse(hdst, &JCh, &xyz);
        printf("xyz=[%f %f %f]\n", xyz.X, xyz.Y, xyz.Z);
    }



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to