Thread: [Lcms-user] Lab to CMYK problems
An ICC-based CMM for color management
Brought to you by:
mm2
From: Richard M. <ri...@mo...> - 2002-10-21 06:43:09
|
I'm using a Lab to CMYK profile. The resulting CMY values agree fairly well with the results from another profile library, but the returned lcms K values are virtually always way too low--they're almost always in the range 0-10. So, for example, the other profile library returned (46, 34, 16, 60) and lcms returned (47, 35, 19, 4). Anyone have any suggestions as to what I might be doing wrong? I'm new to lcms.... Thanks in advance. The code is as follows--the Lab values are passed in as a contiguous array "lab" of floats and I'm returning a contiguous array "lcms" of bytes: cmsHPROFILE hInProfile, hOutProfile; cmsHTRANSFORM hTransform; hInProfile = cmsCreateLabProfile(NULL); hOutProfile = cmsOpenProfileFromFile(profile, "r"); hTransform = cmsCreateTransform(hInProfile, TYPE_Lab_16, hOutProfile, TYPE_CMYK_8, INTENT_PERCEPTUAL, 0); cmsCIELab *llab = new cmsCIELab[count]; for (i=0; i < count; ++i) { llab[i].L = lab[3*i]; llab[i].a = lab[3*i+1]; llab[i].b = lab[3*i+2]; } WORD wLab[3]; const double normalize = 100./255.; for (i=0; i < count; ++i) { cmsFloat2LabEncoded(wLab, llab+i); cmsDoTransform(hTransform, wLab, lcms + 4*i, 1); for (int j=0; j < 4; ++j) lcms[4*i+j] = (int)((float)lcms[4*i+j] * normalize + 0.5); } cmsDeleteTransform(hTransform); cmsCloseProfile(hInProfile); cmsCloseProfile(hOutProfile); |
From: <ma...@li...> - 2002-10-21 07:55:48
|
Hi, Humm... Your code seems ok. Have you tried icctrans utility? If it gives same (bad) result, please send me and cmyk profile example and I will take a look. A good check point could be Lab=0,0,0 This should give CMYK=0,0,0,255 Regards, Martí Maria The little cms project http://www.littlecms.com ma...@li... > I'm using a Lab to CMYK profile. The resulting CMY values agree fairly well > with the results from another profile library, but the returned lcms K > values are virtually always way too low--they're almost always in the range > 0-10. So, for example, the other profile library returned > > (46, 34, 16, 60) > > and lcms returned > > (47, 35, 19, 4). > > Anyone have any suggestions as to what I might be doing wrong? I'm new to > lcms.... > > Thanks in advance. > > The code is as follows--the Lab values are passed in as a contiguous array > "lab" of floats and I'm returning a contiguous array "lcms" of bytes: > > cmsHPROFILE hInProfile, hOutProfile; > cmsHTRANSFORM hTransform; > > hInProfile = cmsCreateLabProfile(NULL); > hOutProfile = cmsOpenProfileFromFile(profile, "r"); > hTransform = cmsCreateTransform(hInProfile, > TYPE_Lab_16, > hOutProfile, > TYPE_CMYK_8, > INTENT_PERCEPTUAL, 0); > > > cmsCIELab *llab = new cmsCIELab[count]; > for (i=0; i < count; ++i) { > llab[i].L = lab[3*i]; > llab[i].a = lab[3*i+1]; > llab[i].b = lab[3*i+2]; > } > > WORD wLab[3]; > const double normalize = 100./255.; > for (i=0; i < count; ++i) { > cmsFloat2LabEncoded(wLab, llab+i); > cmsDoTransform(hTransform, wLab, lcms + 4*i, 1); > for (int j=0; j < 4; ++j) > lcms[4*i+j] = (int)((float)lcms[4*i+j] * normalize + 0.5); > } > cmsDeleteTransform(hTransform); > cmsCloseProfile(hInProfile); > cmsCloseProfile(hOutProfile); > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Lcms-user mailing list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user > > |
From: Richard M. <ri...@mo...> - 2002-10-22 06:36:39
|
Thanks, Marti-- After further testing, I'm thinking that lcms is indeed working properly and that the other profile library I got is in error. Interestingly, Lab=0,0,0 never gives 0,0,0,255 for any of the cmyk profiles I used, even though the resulting cmyk values are pretty close to black.... Thanks again Richard -----Original Message----- From: lcm...@li... [mailto:lcm...@li...]On Behalf Of Martí Maria Sent: Monday, October 21, 2002 6:19 AM To: ri...@mo...; lcm...@li... Subject: Re: [Lcms-user] Lab to CMYK problems Hi, Humm... Your code seems ok. Have you tried icctrans utility? If it gives same (bad) result, please send me and cmyk profile example and I will take a look. A good check point could be Lab=0,0,0 This should give CMYK=0,0,0,255 Regards, Martí Maria The little cms project http://www.littlecms.com ma...@li... > I'm using a Lab to CMYK profile. The resulting CMY values agree fairly well > with the results from another profile library, but the returned lcms K > values are virtually always way too low--they're almost always in the range > 0-10. So, for example, the other profile library returned > > (46, 34, 16, 60) > > and lcms returned > > (47, 35, 19, 4). > > Anyone have any suggestions as to what I might be doing wrong? I'm new to > lcms.... > > Thanks in advance. > > The code is as follows--the Lab values are passed in as a contiguous array > "lab" of floats and I'm returning a contiguous array "lcms" of bytes: > > cmsHPROFILE hInProfile, hOutProfile; > cmsHTRANSFORM hTransform; > > hInProfile = cmsCreateLabProfile(NULL); > hOutProfile = cmsOpenProfileFromFile(profile, "r"); > hTransform = cmsCreateTransform(hInProfile, > TYPE_Lab_16, > hOutProfile, > TYPE_CMYK_8, > INTENT_PERCEPTUAL, 0); > > > cmsCIELab *llab = new cmsCIELab[count]; > for (i=0; i < count; ++i) { > llab[i].L = lab[3*i]; > llab[i].a = lab[3*i+1]; > llab[i].b = lab[3*i+2]; > } > > WORD wLab[3]; > const double normalize = 100./255.; > for (i=0; i < count; ++i) { > cmsFloat2LabEncoded(wLab, llab+i); > cmsDoTransform(hTransform, wLab, lcms + 4*i, 1); > for (int j=0; j < 4; ++j) > lcms[4*i+j] = (int)((float)lcms[4*i+j] * normalize + 0.5); > } > cmsDeleteTransform(hTransform); > cmsCloseProfile(hInProfile); > cmsCloseProfile(hOutProfile); > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Lcms-user mailing list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user > > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Lcms-user mailing list Lcm...@li... https://lists.sourceforge.net/lists/listinfo/lcms-user |
From: ADS <tec...@wa...> - 2002-10-21 08:09:50
|
Why not converting to SRGB then by code converting to CMYK? Armindo |