Two thoughts:
If you know your NSImage contains an NSBitmapImageRep you can eliminate the TIFFRepresentation line with something like:
bitmap = [myImage bestRepresentationForDevice:nil];
or
bitmap = [[myImage representations] objectAtIndex:0];
Yes less general and I have no idea if TIFFRepresentation adds significant overhead.
Secondly, if you're not applying any other CIFilters, is there any reason to convert an NSImage to CIImage? I first assumed it was just the simplicity of your example, but now I'm wondering if there is some other reason you'd need a CIImage over an NSImage....
by George — Nov 14
If you know your NSImage contains an NSBitmapImageRep you can eliminate the TIFFRepresentation line with something like:
bitmap = [myImage bestRepresentationForDevice:nil];
or
bitmap = [[myImage representations] objectAtIndex:0];
Yes less general and I have no idea if TIFFRepresentation adds significant overhead.
Secondly, if you're not applying any other CIFilters, is there any reason to convert an NSImage to CIImage? I first assumed it was just the simplicity of your example, but now I'm wondering if there is some other reason you'd need a CIImage over an NSImage....