Am 17.09.04, 21:02 +0800 schrieb Peter:

> Hello,
> 
> I try doing the Lab to CMYK convertion with snippet like below, it works
> 
>     double fLab[3];
>     unsigned char nCMYK[4];
> 
>     fLab[0] = 50.0;
>     fLab[1] = 80.0;
>     fLab[2] = 50.0;
>     hOutProfile = cmsOpenProfileFromFile(szPath, "r");
>     hLabProfile = cmsCreateLabProfile(NULL);
>     hTransform = cmsCreateTransform(hLabProfile,
>                                  TYPE_Lab_DBL,
>                                  hOutProfile,
>                                  TYPE_CMYK_8,
>                                  intent, 0);
> 
>     cmsDoTransform(hTransform, fLab, nCMYK, 1);
>     cmsDeleteTransform(hTransform);
>     cmsCloseProfile(hLabProfile);
>     cmsCloseProfile(hOutProfile);
> 
> But when I change it to Lab 8 bit, it does not produce the similar result.
> 
>     unsigned char nCMYK[4];
>     unsigned char nLab[3];
> 
>     nLab[0] = 50;
>     nLab[1] = 80;
>     nLab[2] = 50;
>     hOutProfile = cmsOpenProfileFromFile(szPath, "r");
>     hLabProfile = cmsCreateLabProfile(NULL);
>     hTransform = cmsCreateTransform(hLabProfile,
>                                  TYPE_Lab_8,
>                                  hOutProfile,
>                                  TYPE_CMYK_8,
>                                  intent, 0);
> 
>     cmsDoTransform(hTransform, nLab, nCMYK, 1);
>     cmsDeleteTransform(hTransform);
>     cmsCloseProfile(hLabProfile);
>     cmsCloseProfile(hOutProfile);
> 
> Is it because Lab values are different for 8 bit format & double format ?

You can set

  nLab[0] = fLab[0] * 255.0 / 100.0;
  nLab[1] = fLab[1] + 127.0;
  nLab[2] = fLab[2] + 127.0;

 
> The range is something like this ?
> L = 0 to 100
> a = -127 to 127
> b = -127 to 127

correct
 
regards
Kai-Uwe Behrmann
                                + imaging development / panoramas
                                + color management
                                + email :[EMAIL PROTECTED]



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Lcms-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to