While Changxing Wang's answer is indeed correct, Apple says UIImage.CIImage will not always work. In particular, from PocketCoreImage:
// Create a CIImage from the _inputImage. While UIImage has a property returning // a CIImage representation of it, there are cases where it will not work. This is the // most compatible route. _filteredImage = [[CIImage alloc] initWithCGImage:_inputImage.CGImage options:nil];
Apple also uses the following, which does NOT work for me:
[UIImage imageWithCIImage:_filteredImage]
My personal implementation adapted from this post works for me:
Chris Vander Mey Jun 20 2018-12-12T00: 00Z
source share