我正在尝试将NSImage转换为CIImage。但是在此过程中,图像质量似乎有很大的损失。我认为这是因为“TIFFRepresentation”。有没有更好的方法?非常感谢。
NSImage *image = [[NSImage alloc] initWithData:[someSource dataRepresentation]];
NSData * tiffData = [image TIFFRepresentation];
CIImage *backgroundCIImage = [[CIImage alloc] initWithData:tiffData];
CIContext *ciContext = [[NSGraphicsContext currentContext] CIContext];
[ciContext drawImage:backgroundCIImage atPoint:CGPointZero fromRect:someRect];