I play with a Core Image framework. As I understand it, if I have an image ( NSImage ), I first need to convert it to CIImage . I can do it.
NSImage *im1 = [[NSImage alloc] initWithContentsOfFile:imagepath]; NSRect rect1;rect1.size.width = img1.size.width; rect1.size.height = img1.size.height; CGImageRef imageRef1 = [img1 CGImageForProposedRect:&rect1 context:[NSGraphicsContext currentContext] hints:nil]; CIImage *ciimage = [CIImage imageWithCGImage:imageRef1];
I have a function that applies a Core Image filter to a main image ( CIImage ) that I want to test. And I want to add the output image to the window as a preview. Therefore I need NSImage. How to convert this main image back to NSImage? If I ask Google, I will not get good results.
Thank you for your help.
source share