views:

123

answers:

0

I am trying to create a image sized 1X1 in CMYK color space. as first step I am creating bitmapContext as

CGColorSpaceRef cmykcolorSpace = CGColorSpaceCreateDeviceCMYK();
CGContextRef currentcontext = CGBitmapContextCreate(NULL,
          1,
          1,
          8, //bitsPerComponent
          4, // bytesPerRow
          cmykcolorSpace,
          kCGImageAlphaNone );

No matter what the combination for bitsPerComponent(8,16 or 32) for supported CMYK, there's always same error Unsupported pixel description - 4 components, 8 bits-per-component, 32 bits-per-pixel

Any help is appreicated.

These are the supported pixel formats

32 bpp, 8 bpc, kCGImageAlphaNone
64 bpp, 16 bpc, kCGImageAlphaNone
128 bpp, 32 bpc, kCGImageAlphaNone | kCGBitmapFloatComponents