Thanks very much, Marti. Colour spaces are quite interesting!
I will play around with this code.

On Mon, Feb 20, 2017 at 12:04 PM, Martí Maria <marti.ma...@littlecms.com>
wrote:

>
> Hi,
>
> I just C&P from testbed, sorry.
>
> A portable function should be like this:
>
> static
> cmsHPROFILE Create_Gray22(void)
> {
>     cmsHPROFILE hProfile;
>     cmsToneCurve* Curve = cmsBuildGamma(0, 2.2);
>     if (Curve == NULL) return NULL;
>
>     hProfile = cmsCreateGrayProfileTHR(0, cmsD50_xyY(), Curve);
>     cmsFreeToneCurve(Curve);
>
>     return hProfile;
> }
> Regards
> Marti
>
>
>
> On 20/02/2017 17:33, Aaron Boxer wrote:
>
> Thanks, Marti. Is the white point and transfer function not already
> specified in the profile? Pardon my ignorance,
> not that familiar with colour transforms.
>
> On Mon, Feb 20, 2017 at 11:28 AM, Martí Maria <marti.ma...@littlecms.com>
> wrote:
>
>>
>> Hi,
>>
>> You need to specify white point and transfer function to
>> cmsCreateGrayProfile(), see manual page 28
>>
>> Regards
>>
>> Marti
>> On 20/02/2017 7:04, Aaron Boxer wrote:
>>
>> Hello,
>>
>> I have a jpeg 2000 file with an ICC profile.
>>
>> PCS is cmsSigXYZData and color space is cmsSigGrayData.
>>
>> The file can be found here:  https://github.com/GrokImageCo
>> mpression/grok/issues/38
>>
>> I am working on a library that decodes the jpeg 2000 file and applies the
>> ICC profile, using LCMS.
>>
>> Currently, I have this code:
>>
>>  in_type = TYPE_GRAY_8;
>>  out_type = TYPE_RGB_8;
>>  out_prof = cmsCreate_sRGBProfile();
>>
>> and I can create the transform and apply the ICC profile, but the output
>> is an RGB file.
>> What I would like is to output a grayscale file.
>>
>> So, if I instead call
>>
>> out_prof = cmsCreateGrayProfile(NULL,NULL);
>>
>> then cmsCreateTransform  returns NULL and I can't apply the profile.
>>
>>
>> What is the best way of creating a transform for this kind of grayscale
>> image ?
>>
>> Thanks so much,
>> Aaron
>>
>>
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>
>> _______________________________________________
>> Lcms-user mailing 
>> listLcms-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/lcms-user
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most engaging
>> tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________ Lcms-user mailing list
>> Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/
>> lists/listinfo/lcms-user
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>
> _______________________________________________
> Lcms-user mailing 
> listLcms-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/lcms-user
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to