I get a nil no matter what I try to load a CIImage directly from file. However I can load the file into a UIImage and convert that to CIImage.
So, this works:
let testUIImage = UIImage(named: "image_0001.jpg")!
let testCIImage = CIImage(image: testUIImage) // OK
but this doesn't:
let testCIImage = CIImage(contentsOf: URL(string: "image_0001.jpg")!) // returns nil
What am I doing wrong? Is it the URL?
UIImage(named: "name.ext")is a convenience initializer. It's a short form ofURL(string:expects a string representing a full URL starting with a scheme for exampleor