• 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: glenn andreas <email@hidden>
  • Date: Sat, 11 Aug 2007 10:18:01 -0500


On Aug 10, 2007, at 6:48 PM, 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.

There are so many approaches to take. Please could somebody suggest a
faster strategy?

Core Image

I'd recommend using ColorSync - you can attach the appropriate profile to your image and it'll draw it black & white (or otherwise adjust it). Draw it in a second image image and it'll convert the data for you. This also gives you the ability to keep your original data as is, and only B&W it when displayed.


The result is much easier (since it's just a single call to attach the profile) and supports pre 10.4 systems - the only difficult part is creating the profile that maps things like you want (creating and tweaking profiles can be a bit of a black art).


Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium | flame : flame fractals & strange attractors : build, mutate, evolve, animate




_______________________________________________

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


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: convert NSBitmapImageRep to black/white depending on pixel hsb
  • Next by Date: Re: convert NSBitmapImageRep to black/white depending on pixel hsb
  • 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