简体   繁体   中英

Convert NSImage to binary image (1-bit)

How can I 'binarize' an NSImage (or an NSBitmapImageRep if that's a better approach)?

I understand the concept of thresholding an image to turn it into a 1-bit image. I don't know, though, whether this are already methods/functions to do this to an NSImage, or whether I must manually iterate over the pixels, and deal with each pixel.

There are Core Image filters designed for this; check out the answer to this question .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM