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!)
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…