• 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: Inverting a black and white NSImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inverting a black and white NSImage


  • Subject: Re: Inverting a black and white NSImage
  • From: Randall Meadows <email@hidden>
  • Date: Wed, 13 May 2009 17:08:57 -0600

On May 13, 2009, at 4:59 PM, Eric Gorr wrote:

I have a black and white NSImage with some pixels in the image totally transparent.

I need to change the white pixels to black, the black pixels to white, and leave the transparent area in the image alone.

The only solution that comes immediately to mind is to get a bitmap representation of the image, loop over all of the pixels and invert each one by one. Based on the kind of image I am dealing with, this should be just fine.

However, I am thinking there is an easier solution, but my mind is drawing a blank - probably because it is getting late and I should go home.

Use the CIColorInvert Core Image filter.

_______________________________________________

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: 
 >Inverting a black and white NSImage (From: Eric Gorr <email@hidden>)

  • Prev by Date: Inverting a black and white NSImage
  • Next by Date: Re: WTF? Is a file corrupted?
  • Previous by thread: Inverting a black and white NSImage
  • Next by thread: Re: Inverting a black and white NSImage
  • Index(es):
    • Date
    • Thread