Nuke Documentation

Protocol Image​Decoding

public protocol ImageDecoding  

An image decoder.

A decoder is a one-shot object created for a single image decoding session.

ImageDecoding ImageDecoding ImageDecoderRegistering ImageDecoderRegistering ImageDecoderRegistering->ImageDecoding ImageDecoders.Empty ImageDecoders.Empty ImageDecoders.Empty->ImageDecoding ImageDecoders.Default ImageDecoders.Default ImageDecoders.Default->ImageDecoding

Types Conforming to Image​Decoding


A decoder that supports all of the formats natively supported by the system.


A decoder that returns an empty placeholder image and attaches image data to the image container.


An image decoder which supports automatically registering in the decoder register.

Default Implementations


public var isAsynchronous: Bool  

Returns true by default.


public func decodePartiallyDownloadedData(_ data: Data) -> ImageContainer?  

The default implementation which simply returns nil (no progressive decoding available).



var isAsynchronous: Bool  

Return true if you want the decoding to be performed on the decoding queue (see imageDecodingQueue). If false, the decoding will be performed synchronously on the pipeline operation queue. By default, true.


func decode(_ data: Data) -> ImageContainer? 

Produces an image from the given image data.


func decodePartiallyDownloadedData(_ data: Data) -> ImageContainer? 

Produces an image from the given partially dowloaded image data. This method might be called multiple times during a single decoding session. When the image download is complete, decode(data:) method is called.


nil by default.