• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: convert NSBitmapImageRep to black/white depending on pixel hsb
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: convert NSBitmapImageRep to black/white depending on pixel hsb


  • Subject: Re: convert NSBitmapImageRep to black/white depending on pixel hsb
  • From: Michael Watson <email@hidden>
  • Date: Fri, 10 Aug 2007 21:33:33 -0400

As Shawn said, Core Image has this functionality built-in, and it's quite fast. But I'm puzzeld as to why it took you "minutes" to scan the pixels of such a small bitmap and perform this transformation.

What, exactly, does your code look like?


-- m-s

On 10 Aug, 2007, at 19:48, Shawn Erickson wrote:

On 8/10/07, email@hidden <email@hidden> wrote:
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?

Core Image

-Shawn
_______________________________________________

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:
40bungie.org


This email sent to email@hidden

_______________________________________________

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


  • Follow-Ups:
    • Re: convert NSBitmapImageRep to black/white depending on pixel hsb
      • From: Uli Kusterer <email@hidden>
References: 
 >convert NSBitmapImageRep to black/white depending on pixel hsb (From: email@hidden)
 >Re: convert NSBitmapImageRep to black/white depending on pixel hsb (From: "Shawn Erickson" <email@hidden>)

  • Prev by Date: Re: Watching folders for new files and event handling based on that?
  • Next by Date: Prevent NSDrawer dragging
  • Previous by thread: Re: convert NSBitmapImageRep to black/white depending on pixel hsb
  • Next by thread: Re: convert NSBitmapImageRep to black/white depending on pixel hsb
  • Index(es):
    • Date
    • Thread