NSImage : how to crop?

I would recommend avoiding Core Image for this. Apple even suggest in the docs to use CGimage cropping functions instead of CIImage cropping functions.

Core Image will load the image to the GPU, crop it, radterize to bitmap data, then transfer that data to RAM before being able to save it.

Not only is this expensive, but it can also fail easily (bugs in OS, GPU limitations, wind blowing in the wrong direction), when it fails you just get a black image.

Look into CGImageCreateWithImageInRect, then create NSImages from the CGImages.

https://developer.apple.com/documentation/coregraphics/1454683-cgimagecreatewithimageinrect?language=objc

Which leads me to ask, why do you need lots of NSImages? If you’re simply drawing them in a NSView, you can get a CGContext from the current NSGraphicsContext and draw CGImages directly there, utilizing all the power that a CGContext can offer.