Framework

Core Image

Use built-in or custom filters to process still and video images.

Overview

Core Image is an image processing and analysis technology that provides high-performance processing for still and video images. Use the many built-in image filters to process images and build complex effects by chaining filters. For details, see Core Image Filter Reference.

You can also create new effects with custom filters and image processors; see Core Image Programming Guide.

Topics

First Steps

Processing an Image Using Built-in Filters

Apply effects such as sepia tint, highlight strengthening, and scaling to images.

class CIImage

A representation of an image to be processed or produced by Core Image filters.

class CIFilter

An image processor that produces an image by manipulating one or more input images or by generating new image data.

class CIContext

An evaluation context for rendering image processing results and performing image analysis.

Basic Data Types

Colors, vectors, and other types used in applying or creating image filters.

Filter Recipes

Applying a Chroma Key Effect

Replace a color in one image with the background from another.

Selectively Focusing on an Image

Focus on a part of an image by applying Gaussian blur and gradient masks.

Customizing Image Transitions

Transition between images in creative ways using Core Image filters.

Simulating Scratchy Analog Film

Degrade the quality of an image to make it look like dated, scratchy analog film.

Custom Filters

Use the Core Image Kernel Language to create universal image processing routines that work in any Core Image context.

Writing Custom Kernels

Write your own custom kernels in either the Core Image Kernel Language or the Metal Shading Language.

class CIKernel

A GPU-based image processing routine used to create custom Core Image filters.

class CIColorKernel

A GPU-based image processing routine that processes only the color information in images, used to create custom Core Image filters.

class CIWarpKernel

A GPU-based image processing routine that processes only the geometry information in an image, used to create custom Core Image filters.

class CIBlendKernel

A GPU-based image processing routine that is optimized for blending two images.

class CISampler

An object that retrieves pixel samples for processing by a filter kernel.

Prototyping Your App’s Core Image Pipeline with Python

Write and test Core Image filters, kernels, and geometric transformations in Python.

Custom Image Processors

Access image content directly to use other image processing technologies within a Core Image workflow.

class CIImageProcessorKernel

The abstract class you extend to create custom image processors that can integrate with Core Image workflows.

protocol CIImageProcessorInput

A container of image data and information for use in a custom image processor.

protocol CIImageProcessorOutput

A container for writing image data and information produced by a custom image processor.

Custom Render Destination

class CIRenderDestination

A specification for configuring all attributes of a render task's destination and issuing asynchronous render tasks.

class CIRenderInfo

An encapsulation of a render task's timing, passes, and pixels processed.

class CIRenderTask

A single render task issued in conjunction with CIRenderDestination.

Feedback-Based Processing

class CIImageAccumulator

An object that manages feedback-based image processing for tasks such as painting or fluid simulation.

Barcode Descriptions

Model barcode data to create barcode images with Core Image filters or to interpret barcodes detected by Core Image, Vision, or AVFoundation features.

class CIBarcodeDescriptor

An abstract base class that represents a machine readable code's attributes.

class CIQRCodeDescriptor

A concrete subclass of CIBarcodeDescriptor that represents a square QR code symbol.

class CIAztecCodeDescriptor

A concrete subclass of CIBarcodeDescriptor that represents an Aztec code symbol.

class CIPDF417CodeDescriptor

A concrete subclass of CIBarcodeDescriptor that represents a PDF 417 symbol.

class CIDataMatrixCodeDescriptor

A concrete subclass of CIBarcodeDescriptor that represents a Data Matrix code symbol.

Image Feature Detection

In macOS 10.13, iOS 11, and tvOS 11 or later, the Vision framework replaces these classes for identifying and analyzing image features.

class CIDetector

An image processor that identifies notable features (such as faces and barcodes) in a still image or video.

class CIFeature

The abstract superclass for objects representing notable features detected in an image.

class CIFaceFeature

Information about a face detected in a still or video image.

class CIRectangleFeature

Information about a rectangular region detected in a still or video image.

class CITextFeature

Information about a region likely to contain text detected in a still or video image.

class CIQRCodeFeature

Information about a Quick Response code (a kind of 2D barcode) detected in a still or video image.

Image Units

In macOS, create and package custom filters as image units that other apps can load as plug-ins, or discover and load image units published by third-party apps.

class CIPlugIn

The mechanism for loading image units in macOS.

class CIFilterGenerator

An object that creates and configures chains of individual image filters.

protocol CIPlugInRegistration

The interface for loading Core Image image units.

protocol CIFilterConstructor

A general interface for objects that produce CIFilter instances.