|
From: Derek B. N. <de...@gl...> - 2022-03-22 22:28:01
|
I'm seeing very different output in one particular case, after
upgrading from 2.12 to 2.13 (or 2.13.1).
The input profile is from a PDF file, and claims to be e-sRGB. With
INTENT_RELATIVE_COLORIMETRIC and cmsFLAGS_BLACKPOINTCOMPENSATION, the
transform to sRGB (builtin profile) produces completely different
results.
The code looks like this (error checking and cleanup intentionally
omitted):
#include <stdio.h>
#include <lcms2.h>
int main() {
cmsHPROFILE inputProfile = cmsOpenProfileFromFile("profile.icc", "r");
cmsHPROFILE outputProfile = cmsCreate_sRGBProfile();
cmsHTRANSFORM xform = cmsCreateTransform(inputProfile, TYPE_RGB_8,
outputProfile, TYPE_RGB_8,
INTENT_RELATIVE_COLORIMETRIC,
cmsFLAGS_BLACKPOINTCOMPENSATION);
unsigned char in[3] = {0x61, 0x61, 0x61};
unsigned char out[3];
cmsDoTransform(xform, in, out, 1);
printf("%02x %02x %02x\n", out[0], out[1], out[2]);
}
and I'm attaching the profile.
The results with 2.12 are "1e 1e 1e" and with 2.13 (same with 2.13.1)
are "9f 9f 9f".
I pulled the profile out of a PDF file, so it's possible there's a
problem in the profile itself -- but I'm not seeing any error messages
from LCMS if I use cmsSetLogErrorHandler.
If anyone has some idea of what's going on here, I'd love to know.
Thanks!
|