Wide-gamut preview in macOS

For me, those are two completely opposite statements. As far as I understand, currently Cairo is “color profile agnostic” on Linux & Windows, where the pixels are sent to screen directly without any ICC manipulation, while it isn’t under OSX, where the pixels are assumed (by mistake, AFAIK) to be sRGB and then converted to the display profile.

During my investigations I could figure out a possible clean solution, but it seems to be excluded by the crappy OSX API. The fact is that under OSX cairo copies the pixels data into a CGImage structure, and then the CGImage is copied into the CGGraphicsContext associated to the output device for the final rendering. This is where the ICC conversion happens, because the CGImage has an associated sRGB profile (while the original goal of the developers was to assign the display profile to the CGImage).

The solution should be that Cairo would take the ICC profile from the output CGGraphicsContext, and assign this profile to the CGImage that is used to render the pixel data… however, in the OSX API I could not find any documented way to obtain the ICC profile associated to a CGGraphicsContext. Without that, I’m stuck and I can only figure out some dirty workarounds…

Is there any OSX developer in this community that could help? Otherwise I will try to post a message to the apple development forum…

1 Like