Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable Color Management in CoreImage

I want to disable Color management as described in the best performance Guide by Apple:

  • https://developer.apple.com/library/content/documentation/GraphicsImaging/Conceptual/CoreImaging/ci_performance/ci_performance.html

It says that I have to set null to the kCIImageColorSpace. As cifilter?.setValue("null", forKey: kCIImageColorSpace) didn't get me any results (App Crashed).

I read the documentation:

  • https://developer.apple.com/documentation/coreimage/kciimagecolorspace)

where it says that I have to specify the NSNull object as value. However cifilter?.setValue(NSNull(), forKey kCIImageColorSpace) also caused a crash:

Class is not key value coding compliant for the key CIImageColorSpace

What is the right command to do this?


1 Answers

You need to set the color space when creating the CIContext not to the CIFilter. This is what I'm doing:

[CIContext contextWithOptions:@{kCIContextWorkingColorSpace : [NSNull null]}];

You should follow the link they posted at then end of the suggestion: Building Your Own Workflow with a Core Image Context

like image 60
l-l Avatar answered Nov 18 '25 12:11

l-l



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!