• 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
NSReadPixel returning different colors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSReadPixel returning different colors


  • Subject: NSReadPixel returning different colors
  • From: Richard Holliday <email@hidden>
  • Date: Mon, 08 Jan 2007 06:32:46 -0800

Hello,

OS: 10.4.8 & 10.2.8

I'm attempting to read a pixel color value from a PNG file using the following code:

NSImage *image = [NSImage imageNamed:@"colorMap.png"];

NSPoint aPoint = NSMakePoint(0,0);

[image lockFocus];
NSColor *aColor = NSReadPixel(aPoint);
[image unlockFocus];

The original pixel color in the PNG file is R:153 G:255 B:153.

On the 10.4 machine I get back R: 0.6 G: 1.0 B: 0.6
On the 10.2 machine I get back R: 0.53 G: 1.0 B 0.53

I understand this is being color adjusted by the system but I just need the raw values with nothing adjusted in any way.

Is there a way to obtain the original values consistantly?


Thanks,

Richard

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: NSReadPixel returning different colors
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: Dead application but live Text control
  • Next by Date: Re: NSReadPixel returning different colors
  • Previous by thread: Re: Dead application but live Text control
  • Next by thread: Re: NSReadPixel returning different colors
  • Index(es):
    • Date
    • Thread