Thread: [Lcms-user] How to create a gray profile with L-star grey response?
An ICC-based CMM for color management
Brought to you by:
mm2
|
From: Marco F. <Mar...@en...> - 2016-05-24 10:54:22
|
Hi!
I'm trying to create a gray profile that has an L* (L-star) response curve, but I'm a little confused about the "parametric tone curve" syntax.
Is there an example how to create the correct tone curve? I guess I need the inverted version of L* companding, right? Would that be a 4 parametric curve, with:
y(Gamma) = 3.0
a=1.0/1.16
b=0.16/1.16
c=100.0/903.3
d=0.008856*903.3/100.0
So in code something like that:
cmsFloat64Number lStarParams[5] = { 3.0, 1.0/1.16, 0.16/1.16, 100.0/903.3, 0.008856*903.3/100.0 };
cmsBuildParametricToneCurve( ctx, 4, lStarParams );
???
Or is it as easy as passing a NULL for the TransferFunction parameter in cmsCreateGrayProfileTHR() because the response matches the PCS response?
Thanks,
Marco
|
|
From: Elle S. <ell...@ni...> - 2016-05-24 12:31:30
|
On 05/24/2016 06:54 AM, Marco Freudenberger wrote:
> Hi!
>
> I'm trying to create a gray profile that has an L* (L-star) response
> curve, but I'm a little confused about the "parametric tone curve" syntax.
>
> Is there an example how to create the correct tone curve? I guess I need
> the inverted version of L* companding, right? Would that be a 4
> parametric curve, with:
>
> y(Gamma) = 3.0
>
> a=1.0/1.16
>
> b=0.16/1.16
>
> c=100.0/903.3
>
> d=0.008856*903.3/100.0
>
> So in code something like that:
>
> cmsFloat64Number lStarParams[5] = { 3.0, 1.0/1.16, 0.16/1.16,
> 100.0/903.3, 0.008856*903.3/100.0 };
>
FWIW (I'm no expert!), I use these parameters to make the Lab parametric
curve:
cmsFloat64Number labl_parameters[5] =
{ 3.0, 1.0/1.16, 0.16/1.16, 2700.0/24389.0, 0.08000 };
The parameters are from these two pages:
http://brucelindbloom.com/index.html?Eqn_RGB_to_XYZ.html
http://brucelindbloom.com/index.html?LContinuity.html
Where does the equation for your last parameter come from? I've always
used Lindbloom's values and he gives 0.08.
Best,
Elle
--
http://ninedegreesbelow.com
Color management and free/libre photography
|
|
From: Marco F. <Mar...@en...> - 2016-05-24 13:07:29
|
Hi ! Thanks for your response, looks like I'm on the right path, your solution looks pretty similar - and BTW, I take your comment that you are no expert as an understatement, I've visited your website a couple of times and think it's a great reference and shows a lot of knowledge and experience :-) Regarding my last parameter value: I indirectly took it off Bruce Lindbloom's site as well :-) Unfortunately, I missed the page you linked with the "Inverse Companding" somehow, I started at the "(forward) Companding" page (http://brucelindbloom.com/index.html?Eqn_RGB_to_XYZ.html) and did the math to revert it. For the last parameter I started with: e(epsilon) = 0.008856, K(kappa) = 903.3 so I'm calculating: e' = e * K / 100.0 (as e <= e). It's very close to 0.08 anyways :-) However, I used the numbers that Bruce lists as "Actual CIE Standard". Thanks to your second link (and I've seen that page before, but didn't remember it when I needed it ...) I realized that the values given as "Intent of the CIE Standard" as you are using them are probably the better values... and with e = 216/23489 and K = 23489/27, e' turns out to be 216/2700 = 2/25 = exactly 0.08... Thanks and best regards, Marco PS - to the group: I'm still wondering what would happen if I'd simply set the TransferFunction to NULL... -----Original Message----- From: Elle Stone [mailto:ell...@ni...] Sent: Dienstag, 24. Mai 2016 14:08 To: lcm...@li... Subject: Re: [Lcms-user] How to create a gray profile with L-star grey response? On 05/24/2016 06:54 AM, Marco Freudenberger wrote: > Hi! > > I'm trying to create a gray profile that has an L* (L-star) response > curve, but I'm a little confused about the "parametric tone curve" syntax. > > Is there an example how to create the correct tone curve? I guess I > need the inverted version of L* companding, right? Would that be a 4 > parametric curve, with: > > y(Gamma) = 3.0 > > a=1.0/1.16 > > b=0.16/1.16 > > c=100.0/903.3 > > d=0.008856*903.3/100.0 > > So in code something like that: > > cmsFloat64Number lStarParams[5] = { 3.0, 1.0/1.16, 0.16/1.16, > 100.0/903.3, 0.008856*903.3/100.0 }; > FWIW (I'm no expert!), I use these parameters to make the Lab parametric curve: cmsFloat64Number labl_parameters[5] = { 3.0, 1.0/1.16, 0.16/1.16, 2700.0/24389.0, 0.08000 }; The parameters are from these two pages: http://brucelindbloom.com/index.html?Eqn_RGB_to_XYZ.html http://brucelindbloom.com/index.html?LContinuity.html Where does the equation for your last parameter come from? I've always used Lindbloom's values and he gives 0.08. Best, Elle -- http://ninedegreesbelow.com Color management and free/libre photography ------------------------------------------------------------------------------ Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j _______________________________________________ Lcms-user mailing list Lcm...@li... https://lists.sourceforge.net/lists/listinfo/lcms-user |
|
From: Florian H. <lis...@ho...> - 2016-05-24 13:18:58
|
Hi, Am 24.05.2016 um 15:07 schrieb Marco Freudenberger: > PS - to the group: I'm still wondering what would happen if I'd simply set the TransferFunction to NULL... That would result in a gamma 1.0 response I think (according to the ICC spec). Florian. |
|
From: Marco F. <Mar...@en...> - 2016-05-24 14:14:33
|
Marti, sorry, I'm not sure I understand your answer. My intention is gray with L*, not Linear gray (Gamma 1.0), using the cmsBuildGamma would give me a gamma 1.0 response curve, though - at least when used with cmsCreateGrayProfile, right? Or am I missing something? Are you suggesting I'm creating the profile "low level"? Something like: cmsHPROFILE hProfile = cmsCreateProfilePlaceholder(ctx); cmsSetProfileVersion(hProfile, 4.3); cmsSetDeviceClass(hProfile, cmsSigDisplayClass); // or better abstract? cmsSetColorSpace(hProfile, cmsSigGrayData); cmsSetPCS(hProfile, cmsSigLabData); cmsSetHeaderRenderingIntent(hProfile, INTENT_RELATIVE_COLORIMETRIC); SetTextTags(hProfile, L"gray L-star") cmsCIEXYZ wpxyz; cmsxyY2XYZ(&wpxyz, WhitePoint); cmsWriteTag(hProfile, cmsSigMediaWhitePointTag, &wpxyz); cmsToneCurve* tc = cmsBuildGamma(ctx, 1.0); // 1.0 gamma from Lab = L* ??????? cmsWriteTag(hProfile, cmsSigGrayTRCTag, (void*)tc)); cmsFreeToneCurve(tc); -----Original Message----- From: Marti Maria [mailto:mar...@li...] Sent: Dienstag, 24. Mai 2016 15:50 To: Marco Freudenberger; 'Florian Höch'; lcm...@li... Subject: RE: [Lcms-user] How to create a gray profile with L-star grey response? Right, mark the PCS as Lab and use cmdBuildGamma(NULL, 1.0). You only need to add the white point and this curve. Marti Maria The LittleCMS project http://www.littlecms.com -----Original Message----- From: Florian Höch [mailto:lis...@ho...] Sent: martes, 24 de mayo de 2016 15:19 To: lcm...@li... Subject: Re: [Lcms-user] How to create a gray profile with L-star grey response? Hi, Am 24.05.2016 um 15:07 schrieb Marco Freudenberger: > PS - to the group: I'm still wondering what would happen if I'd simply > set the TransferFunction to NULL... That would result in a gamma 1.0 response I think (according to the ICC spec). Florian. ---------------------------------------------------------------------------- -- Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j _______________________________________________ Lcms-user mailing list Lcm...@li... https://lists.sourceforge.net/lists/listinfo/lcms-user |
|
From: Marti M. <mar...@li...> - 2016-05-24 13:48:15
|
Right, mark the PCS as Lab and use cmdBuildGamma(NULL, 1.0). You only need to add the white point and this curve. Marti Maria The LittleCMS project http://www.littlecms.com -----Original Message----- From: Florian Höch [mailto:lis...@ho...] Sent: martes, 24 de mayo de 2016 15:19 To: lcm...@li... Subject: Re: [Lcms-user] How to create a gray profile with L-star grey response? Hi, Am 24.05.2016 um 15:07 schrieb Marco Freudenberger: > PS - to the group: I'm still wondering what would happen if I'd simply set the TransferFunction to NULL... That would result in a gamma 1.0 response I think (according to the ICC spec). Florian. ---------------------------------------------------------------------------- -- Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j _______________________________________________ Lcms-user mailing list Lcm...@li... https://lists.sourceforge.net/lists/listinfo/lcms-user |
|
From: Marti M. <mar...@li...> - 2016-05-24 14:17:31
|
Hi, Yes, that one. If you use cmsBuildGamma() you are forced to XYZ PCS, but if you use low-level you can use Lab PCS as well. Regards Marti Maria The LittleCMS project http://www.littlecms.com -----Original Message----- From: Marco Freudenberger [mailto:Mar...@en...] Sent: martes, 24 de mayo de 2016 16:14 To: Marti Maria <mar...@li...>; 'Florian Höch' <lis...@ho...>; lcm...@li... Subject: RE: [Lcms-user] How to create a gray profile with L-star grey response? Marti, sorry, I'm not sure I understand your answer. My intention is gray with L*, not Linear gray (Gamma 1.0), using the cmsBuildGamma would give me a gamma 1.0 response curve, though - at least when used with cmsCreateGrayProfile, right? Or am I missing something? Are you suggesting I'm creating the profile "low level"? Something like: cmsHPROFILE hProfile = cmsCreateProfilePlaceholder(ctx); cmsSetProfileVersion(hProfile, 4.3); cmsSetDeviceClass(hProfile, cmsSigDisplayClass); // or better abstract? cmsSetColorSpace(hProfile, cmsSigGrayData); cmsSetPCS(hProfile, cmsSigLabData); cmsSetHeaderRenderingIntent(hProfile, INTENT_RELATIVE_COLORIMETRIC); SetTextTags(hProfile, L"gray L-star") cmsCIEXYZ wpxyz; cmsxyY2XYZ(&wpxyz, WhitePoint); cmsWriteTag(hProfile, cmsSigMediaWhitePointTag, &wpxyz); cmsToneCurve* tc = cmsBuildGamma(ctx, 1.0); // 1.0 gamma from Lab = L* ??????? cmsWriteTag(hProfile, cmsSigGrayTRCTag, (void*)tc)); cmsFreeToneCurve(tc); -----Original Message----- From: Marti Maria [mailto:mar...@li...] Sent: Dienstag, 24. Mai 2016 15:50 To: Marco Freudenberger; 'Florian Höch'; lcm...@li... Subject: RE: [Lcms-user] How to create a gray profile with L-star grey response? Right, mark the PCS as Lab and use cmdBuildGamma(NULL, 1.0). You only need to add the white point and this curve. Marti Maria The LittleCMS project http://www.littlecms.com -----Original Message----- From: Florian Höch [mailto:lis...@ho...] Sent: martes, 24 de mayo de 2016 15:19 To: lcm...@li... Subject: Re: [Lcms-user] How to create a gray profile with L-star grey response? Hi, Am 24.05.2016 um 15:07 schrieb Marco Freudenberger: > PS - to the group: I'm still wondering what would happen if I'd simply > set the TransferFunction to NULL... That would result in a gamma 1.0 response I think (according to the ICC spec). Florian. ---------------------------------------------------------------------------- -- Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j _______________________________________________ Lcms-user mailing list Lcm...@li... https://lists.sourceforge.net/lists/listinfo/lcms-user |
|
From: Marco F. <Mar...@en...> - 2016-05-24 14:21:46
|
OK, I'll give it a shot and try it. Thanks again, Elle, Marti, Florian for your answers! Marco -----Original Message----- From: Marti Maria [mailto:mar...@li...] Sent: Dienstag, 24. Mai 2016 16:19 To: Marco Freudenberger; 'Florian Höch'; lcm...@li... Subject: RE: [Lcms-user] How to create a gray profile with L-star grey response? Hi, Yes, that one. If you use cmsBuildGamma() you are forced to XYZ PCS, but if you use low-level you can use Lab PCS as well. Regards Marti Maria The LittleCMS project http://www.littlecms.com -----Original Message----- From: Marco Freudenberger [mailto:Mar...@en...] Sent: martes, 24 de mayo de 2016 16:14 To: Marti Maria <mar...@li...>; 'Florian Höch' <lis...@ho...>; lcm...@li... Subject: RE: [Lcms-user] How to create a gray profile with L-star grey response? Marti, sorry, I'm not sure I understand your answer. My intention is gray with L*, not Linear gray (Gamma 1.0), using the cmsBuildGamma would give me a gamma 1.0 response curve, though - at least when used with cmsCreateGrayProfile, right? Or am I missing something? Are you suggesting I'm creating the profile "low level"? Something like: cmsHPROFILE hProfile = cmsCreateProfilePlaceholder(ctx); cmsSetProfileVersion(hProfile, 4.3); cmsSetDeviceClass(hProfile, cmsSigDisplayClass); // or better abstract? cmsSetColorSpace(hProfile, cmsSigGrayData); cmsSetPCS(hProfile, cmsSigLabData); cmsSetHeaderRenderingIntent(hProfile, INTENT_RELATIVE_COLORIMETRIC); SetTextTags(hProfile, L"gray L-star") cmsCIEXYZ wpxyz; cmsxyY2XYZ(&wpxyz, WhitePoint); cmsWriteTag(hProfile, cmsSigMediaWhitePointTag, &wpxyz); cmsToneCurve* tc = cmsBuildGamma(ctx, 1.0); // 1.0 gamma from Lab = L* ??????? cmsWriteTag(hProfile, cmsSigGrayTRCTag, (void*)tc)); cmsFreeToneCurve(tc); -----Original Message----- From: Marti Maria [mailto:mar...@li...] Sent: Dienstag, 24. Mai 2016 15:50 To: Marco Freudenberger; 'Florian Höch'; lcm...@li... Subject: RE: [Lcms-user] How to create a gray profile with L-star grey response? Right, mark the PCS as Lab and use cmdBuildGamma(NULL, 1.0). You only need to add the white point and this curve. Marti Maria The LittleCMS project http://www.littlecms.com -----Original Message----- From: Florian Höch [mailto:lis...@ho...] Sent: martes, 24 de mayo de 2016 15:19 To: lcm...@li... Subject: Re: [Lcms-user] How to create a gray profile with L-star grey response? Hi, Am 24.05.2016 um 15:07 schrieb Marco Freudenberger: > PS - to the group: I'm still wondering what would happen if I'd simply > set the TransferFunction to NULL... That would result in a gamma 1.0 response I think (according to the ICC spec). Florian. ---------------------------------------------------------------------------- -- Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j _______________________________________________ Lcms-user mailing list Lcm...@li... https://lists.sourceforge.net/lists/listinfo/lcms-user |