Nuke Documentation

Protocol Image​Processing

public protocol ImageProcessing  

Performs image processing.

For basic processing needs, implement the following method:

func process(image: PlatformImage) -> PlatformImage?

If your processor needs to manipulate image metadata (ImageContainer), or get access to more information via the context (ImageProcessingContext), there is an additional method that allows you to do that:

func process(image container: ImageContainer, context: ImageProcessingContext) -> ImageContainer?

You must implement either one of those methods.

ImageProcessing ImageProcessing ImageProcessors.CoreImageFilter ImageProcessors.CoreImageFilter ImageProcessors.CoreImageFilter->ImageProcessing ImageProcessors.GaussianBlur ImageProcessors.GaussianBlur ImageProcessors.GaussianBlur->ImageProcessing ImageProcessors.Resize ImageProcessors.Resize ImageProcessors.Resize->ImageProcessing ImageProcessors.Circle ImageProcessors.Circle ImageProcessors.Circle->ImageProcessing ImageProcessors.Composition ImageProcessors.Composition ImageProcessors.Composition->ImageProcessing ImageProcessors.Anonymous ImageProcessors.Anonymous ImageProcessors.Anonymous->ImageProcessing ImageProcessors.RoundedCorners ImageProcessors.RoundedCorners ImageProcessors.RoundedCorners->ImageProcessing

Types Conforming to Image​Processing


Scales an image to a specified size.


Rounds the corners of an image into a circle. If the image is not a square, crops it to a square first.


Rounds the corners of an image to the specified radius.


Applies Core Image filter (CIFilter) to the image.


Blurs an image using CIGaussianBlur filter.


Composes multiple processors.


Processed an image using a specified closure.

Default Implementations


func process(_ container: ImageContainer, context: ImageProcessingContext) -> ImageContainer?  

The default implementation simply calls the basic process(_ image: PlatformImage) -> PlatformImage? method.


var hashableIdentifier: AnyHashable  

The default impleemntation simply returns var identifier: String.



func process(_ image: PlatformImage) -> PlatformImage? 

Returns a processed image. By default, returns nil.


func process(_ container: ImageContainer, context: ImageProcessingContext) -> ImageContainer? 

Optional method. Returns a processed image. By default, this calls the basic process(image:) method.


var identifier: String  

Returns a string that uniquely identifies the processor.

Consider using the reverse DNS notation.


var hashableIdentifier: AnyHashable  

Returns a unique processor identifier.

The default implementation simply returns var identifier: String but can be overridden as a performance optimization - creating and comparing strings is expensive so you can opt-in to return something which is fast to create and to compare. See ImageProcessors.Resize for an example.