I don't have a problem with Core Image requiring RGB nor with
having to convert the CMYK before feeding it into a CI pipeline.
But how the hell do you convert a CMYK with attached color profile
into RGB using the profile? I can get rotten RGB by
[representation setColorSpaceName: NSDeviceRGBColorSpace]
but it simply discards the profile. Somebody at Apple knows how to do
it because Preview.app does this, but Apple doesn't seem to want
to share this information.
--
SM Ryan http://www.rawbw.com/~wyrmwif/
TEMPORARILY CLOSED
BE OPENED AFTER FIRST PERIOD
> So how the heck do you convert CMYK to RGB to make CoreImage happy?
Naively, you do:
r = 1.0 - (c + k);
g = 1.0 - (m + k);
b = 1.0 - (y + k);
which is plenty fast but the results aren't that great (since it assumes
a "perfect" CMYK and "perfect" RGB color space), but might work f.
The better answer is to use ColorSync, which has all sorts of routines
for converting pixels between different color spaces.
>
> I don't have a problem with Core Image requiring RGB nor with
> having to convert the CMYK before feeding it into a CI pipeline.
>
> But how the hell do you convert a CMYK with attached color profile
> into RGB using the profile? I can get rotten RGB by
> [representation setColorSpaceName: NSDeviceRGBColorSpace]
> but it simply discards the profile. Somebody at Apple knows how to do
> it because Preview.app does this, but Apple doesn't seem to want
> to share this information.
ColorSync is hardly something that Apple is trying to hide...