Wondering if there is a way to isolate a single color in an image either using masks or perhaps even a custom color space. I’m ultimately looking for a fast way to isolate 14 colors out of an image – figured if there was a masking method it might may be faster than walking through the pixels.
Any help is appreciated!
You could use a custom color space (documentation here) and then substitute it for “CGColorSpaceCreateDeviceGray()” in the following code:
This code is from this blog which is worth a look at for removing colors from images.