[Lcms-user] Handling channel extraction
An ICC-based CMM for color management
Brought to you by:
mm2
From: Adrian Knagg-B. <aje...@gm...> - 2023-08-10 15:52:35
|
Hi, I'm trying to understand how to handle assignment of a color profile to a single channel extracted from a colour image that may have an arbitrary RGB color profile (e.g. extracting the R channel). Would something like this work, assuming rgb_profile is the cmsHPROFILE associated with the full RGB image? cmsHPROFILE extracted_profile == NULL; if (cmsIsTag(rgb_profile, cmsSigRedTRCTag) && cmsIsTag(rgb_profile, cmsSigMediaWhitePoint)) { cmsToneCurve tonecurve = cmsReadTag(rgb_profile, cmsSigRedTRCTag); cmsCIExyY whitepoint = cmsReadTag(rgb_profle, cmsSigMediaWhitePoint); extracted_profile = cmsCreateGrayProfile(whitepoint, tonecurve); } Thanks, Adrian. |