How to prevent memory leakage while converting from UIImage to CIImage

70 Views Asked by At

I am trying to convert UIImage to CIImage, but it increases the memory by 80-100 MB. Is this a memory leakage? If so, is there any possible way to reduce the memory leakage on converting UIImage to CIImage?

Here's my code:

extension UIImage {
  func toCIImage() -> CIImage {
    return CIImage(cgImage: self.cgImage!)
  }
}

Also, I am looking for a better solution that wouldn't result in a memory spike converting UIImage to CIImage.

0

There are 0 best solutions below