convert NSBitmapImageRep to black/white depending on pixel hsb
convert NSBitmapImageRep to black/white depending on pixel hsb
- Subject: convert NSBitmapImageRep to black/white depending on pixel hsb
- From: email@hidden
- Date: Sat, 11 Aug 2007 00:59:40 +0200
Hello
I have a coloured NSImage/NSBitmapImageRep and want to make it black
and white, note not gray scale.
It should also be based on the brightness of the pixels.
+ (NSBitmapImage *) getBlackWhiteImage:(NSBitmapImage*)image
brightness:(float) value;
Example all pixels that have a brightness > 0.9 shall be NSColor
whiteColor other pixels shall be NSColor blackColor.
I have tried to loop all pixels one by one and set them, however this
really took minutes on a 500x500 image.
There are so many approaches to take. Please could somebody suggest a
faster strategy?
thank you very much
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden