Re: [Lcms-user] What does cmsFLAGS_NOOPTIMIZE actually do?
An ICC-based CMM for color management
Brought to you by:
mm2
From: Elle S. <l.e...@gm...> - 2012-07-27 11:20:17
|
The comparisons are at: http://ninedegreesbelow.com/temp/icc-profile-conversion-bugs.html http://ninedegreesbelow.com/temp/profile-conversion-errors.html The same problem also happens when converting from linear prophoto to regular prophoto. On 7/27/12, Boudewijn Rempt <bo...@va...> wrote: > Hi! > > I've had a long discussion with Elle Stone who did a huge comparison of the > results image applications have when converting between 16 bits linear rgb > and srgb. It turned out that Krita gave different results from tifficc, so I > dug in a bit and found that the reason was that I didn't use the > cmsFLAGS_NOOPTIMIZE flag when creating transforms, while tifficc does. Code > like this: > > > quint16 src[4]; > src[0] = 257; > src[1] = 257; > src[2] = 257; > src[3] = 65535; > > quint16 dst[4]; > > cmsHPROFILE sRgbProfile = cmsCreate_sRGBProfile(); > QByteArray rawData = linearRgb->profile()->rawData(); // from krita... > it's a linear scRGB profile, as attached. > cmsHPROFILE linearRgbProfile = > cmsOpenProfileFromMem((void*)rawData.constData(), rawData.size()); > > cmsHTRANSFORM tf = cmsCreateTransform(linearRgbProfile, > TYPE_BGRA_16, > sRgbProfile, > TYPE_BGRA_16, > INTENT_RELATIVE_COLORIMETRIC, > cmsFLAGS_NOOPTIMIZE | > cmsFLAGS_BLACKPOINTCOMPENSATION); > > cmsDoTransform(tf, (quint8*)&src, (quint8*)&dst, 1); > > qDebug() << dst[0] << dst[1] << dst[2]; > > > returns 3266,3266,3266, while > > > cmsHTRANSFORM tf = cmsCreateTransform(linearRgbProfile, > TYPE_BGRA_16, > sRgbProfile, > TYPE_BGRA_16, > INTENT_RELATIVE_COLORIMETRIC, > cmsFLAGS_BLACKPOINTCOMPENSATION); > > returns 1595,1595,1595 > > Which surprises me, since I would have thought optimization wouldn't have > any influence on the actual results obtained. Is this a bug, or should I > always use cmsFLAGS_NOOPTIMIZE to get accurate results? > > -- > Boudewijn Rempt > http://www.valdyas.org, http://www.krita.org, http://www.boudewijnrempt.nl > -- http://ninedegreesbelow.com Articles and tutorials on open source digital imaging and photography |