Kingfisher Documentation

Protocol Image​Processor

public protocol ImageProcessor  

An ImageProcessor would be used to convert some downloaded data to an image.

%37 ImageProcessor ImageProcessor DownsamplingImageProcessor DownsamplingImageProcessor DownsamplingImageProcessor->ImageProcessor RoundCornerImageProcessor RoundCornerImageProcessor RoundCornerImageProcessor->ImageProcessor ResizingImageProcessor ResizingImageProcessor ResizingImageProcessor->ImageProcessor CIImageProcessor CIImageProcessor CIImageProcessor->ImageProcessor CroppingImageProcessor CroppingImageProcessor CroppingImageProcessor->ImageProcessor BlurImageProcessor BlurImageProcessor BlurImageProcessor->ImageProcessor GeneralProcessor GeneralProcessor GeneralProcessor->ImageProcessor TintImageProcessor TintImageProcessor TintImageProcessor->ImageProcessor BlendImageProcessor BlendImageProcessor BlendImageProcessor->ImageProcessor OverlayImageProcessor OverlayImageProcessor OverlayImageProcessor->ImageProcessor ColorControlsProcessor ColorControlsProcessor ColorControlsProcessor->ImageProcessor BlackWhiteProcessor BlackWhiteProcessor BlackWhiteProcessor->ImageProcessor CompositingImageProcessor CompositingImageProcessor CompositingImageProcessor->ImageProcessor DefaultImageProcessor DefaultImageProcessor DefaultImageProcessor->ImageProcessor

Types Conforming to Image​Processor


Represents a processor based on a CIImage Filter. It requires a filter to create an ImageProcessor.


The default processor. It converts the input data to a valid image. Images of .PNG, .JPEG and .GIF format are supported. If an image item is given as .image case, DefaultImageProcessor will do nothing on it and return the associated image.


Processor for adding an blend mode to images. Only CG-based images are supported.


Processor for adding an compositing operation to images. Only CG-based images are supported in macOS.


Processor for making round corner images. Only CG-based images are supported in macOS, if a non-CG image passed in, the processor will do nothing.


Processor for resizing images. If you need to resize a data represented image to a smaller size, use DownsamplingImageProcessor instead, which is more efficient and uses less memory.


Processor for adding blur effect to images. Accelerate.framework is used underhood for a better performance. A simulated Gaussian blur with specified blur radius will be applied.


Processor for adding an overlay to images. Only CG-based images are supported in macOS.


Processor for tint images with color. Only CG-based images are supported.


Processor for applying some color control to images. Only CG-based images are supported. watchOS is not supported.


Processor for applying black and white effect to images. Only CG-based images are supported. watchOS is not supported.


Processor for cropping an image. Only CG-based images are supported. watchOS is not supported.


Processor for downsampling an image. Compared to ResizingImageProcessor, this processor does not render the images to resize. Instead, it downsamples the input data directly to an image. It is a more efficient than ResizingImageProcessor. Prefer to use DownsamplingImageProcessor as possible as you can than the ResizingImageProcessor.

Default Implementations


public func append(another: ImageProcessor) -> ImageProcessor  

Appends an ImageProcessor to another. The identifier of the new ImageProcessor will be "(self.identifier)|>(another.identifier)".


another Image​Processor

An ImageProcessor you want to append to self.


The new ImageProcessor will process the image in the order of the two processors concatenated.



var identifier: String  

Identifier of the processor. It will be used to identify the processor when caching and retrieving an image. You might want to make sure that processors with same properties/functionality have the same identifiers, so correct processed images could be retrieved with proper key.


func process(item: ImageProcessItem, options: KingfisherParsedOptionsInfo) -> KFCrossPlatformImage? 

Processes the input ImageProcessItem with this processor.


item Image​Process​Item

Input item which will be processed by self.

options Kingfisher​Parsed​Options​Info

The parsed options when processing the item.


The processed image.