title: disabling color correction in quartz 2d
body: <p>Ok, I know that it's not possible to actually disable color correction in quartz. What I'm looking for is a device-independent color space setting that dosn't change the RGB values I draw in a CGLayer. </p>
  
  <p>I tried all the ICC profiles from the system library, they all shift the colors.</p>
  
  <p>This is the best result I got:</p>
  
  <pre><code>const CGFloat whitePoint[] = {0.95047, 1.0, 1.08883};
  const CGFloat blackPoint[] = {0, 0, 0};
  const CGFloat gamma[] = {1, 1, 1};
  const CGFloat matrix[] = {0.449695, 0.244634, 0.0251829, 0.316251, 0.672034, 0.141184, 0.18452, 0.0833318, 0.922602 };
  CGColorSpaceRef colorSpace = CGColorSpaceCreateCalibratedRGB(whitePoint, blackPoint, gamma, matrix);
  </code></pre>
  
  <p>This uses Apple RGB's color conversion matrix and D65 white point.</p>
  
  <p>The colors still shift a bit, although I'm a lot happier with this than with the device dependent settings.</p>
  
  <p>Here's how I write the CGLayer to a TIFF:</p>
  
  <pre><code>CIImage *image = [CIImage imageWithCGLayer:cgLayer];
  NSBitmapImageRep *bitmapImage = [[NSBitmapImageRep alloc] initWithCIImage:image];
  [[bitmapImage TIFFRepresentation] writeToFile:fileName atomically:YES];
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>