Type Method


Creates a Core Image context from a Quartz context, using the specified options.


+ (CIContext *)contextWithCGContext:(CGContextRef)cgctx options:(NSDictionary<CIContextOption, id> *)options;



A Quartz graphics context (CGContextRef object) either obtained from the system or created using a Quartz function such as CGBitmapContextCreate. See Quartz 2D Programming Guide for information on creating Quartz graphics contexts.


A dictionary that contains color space information. You can pass any of the keys defined in Context Options along with the appropriate value.


After calling this method, Core Image draws content to the specified Quartz graphics context.

When you create a CIContext object using a Quartz graphics context, any transformations that are already set on the Quartz graphics context affect drawing to that context.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software