I'm playing with the Core Image framework. As I understand, if I have an image (NSImage), it needs to be converted into CIImage, first. I can do that.
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 haven't tested it, but I think this should do it:
CIImage *ciImage = ...; NSCIImageRep *rep = [NSCIImageRep imageRepWithCIImage:ciImage]; NSImage *nsImage = [[NSImage alloc] initWithSize:rep.size]; [nsImage addRepresentation:rep];