I'm building an OS X app that needs to save the file to disk.
I'm currently using NSBitmapImageRep
to represent the image in my code, and while saving the image to disk with representationUsingType:properties:
method, I want to set the hasAlpha
channel for the image, but the properties
dictionary does not seem to support this.
So, I've tried to create a no-alpha bitmap representation, but according to many SO questions, the 3 channel/24 bits combination is not supported. Well, what should I do then?
Big thanks!
First off, I would try just making sure you create your NSBitmapImageRep with
And write it out and see if it the result doesn’t have alpha—one would kind of hope so.
If you’re trying to write out an image that has alpha, but not write the alpha, just copy it into a non-alpha image first, and write that out.