I'm trying to get CIImage
from ImageView that display on the screen.
UIImage *image = myImageView.image;
convert image UIImage
to CIImage
.
CIImage *cImage = [....];
How to do this?
CIImage *ciImage = [UIImage imageNamed:@"test.png"].CIImage;
UIImage *uiImage = [[UIImage alloc] initWithCIImage:ciImage];
To fix the case where myUIImage.CIImage
returns nil
like [UIImageView image]
, you can instead do [CIImage imageWithCGImage:myUIImage.CGImage]
– Dylan Hand
Swift version:
let ciImage = UIImage(named: "test.png")!.ciImage
let uiImage = UIImage(ciImage: ciImage)
To fix the case where myUIImage.ciImage
returns nil
like you can instead do CIImage(cgImage: myUIImage!.cgImage!)
.