objective c - iPhone iOS how to instantiate a black and white CGColorSpaceRef? -
i'm working excellent example of converting image grayscale: convert image b&w problem cgcontext - iphone dev
however, purposes, have only pure black , pure white left in image.
it appears so, need pass black , white color space recolor method using call:
cgcolorspaceref colorspace = cgcolorspacecreatewithname(/*black , white name*/); however, unable find proper ios color space names. found mac, , "color space names" referenced ios docs not point anywhere.
how can create black , white cgcolorspaceref?
thank you!
i not familiar black , white color space can calculate total average rgb value pixels (lets call totalavg) , use threshold. meaning each pixel if rgb average greater calculated totalavg set pure white, otherwise set pure black.
i agree bit of more work thats whay can think of unless find colorspace looking for.
Comments
Post a Comment