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

Re: NSReadPixel returning different colors


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

On Monday, January 08, 2007, at 10:42AM, "John Stiles" <email@hidden> wrote:
>Does the PNG have any gamma information in it? I am pretty sure that the
>OS changed at some point to honor the gamma; previously I believe it was
>ignored. So you might want to remove any gamma info.

Thanks for that tip John.

I removed the gamma information (using GammaSlammer) but had the same results. After further reading though it looks as if 10.4 adjusts the gamma for a PNG even if there is no gamma in the file itself.

As a test I converted the file to a BMP format and the pixel color routine works perfectly on both platforms.

If this is in fact a problem inherent to PNGs then I'll have to switch file format when I need exact pixel matching.

Thanks,

Richard


>Richard Holliday wrote:
>> On Monday, January 08, 2007, at 10:07AM, "Andreas Mayer" <email@hidden> wrote:
>>
>>> Am 08.01.2007 um 15:32 Uhr schrieb Richard Holliday:
>>>
>>>
>>>> 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.
>>>>
>>> You mean on 10.2? Well, that might just be a bug.
>>>
>>> The values reported from 10.4 are without any adjustment. 0.6*255 = 153
>>>
>>>
>>
>> Correct, the 10.4 values are fine it's just from 10.2.8.
>>
>> Also, I tried my own code which returns the RGB values via the [NSBitmapImageRep bitmapData] member. This has exactly the same problem which lead me to believe I'm missing something else. As soon as the PNG becomes an NSImage the data gets translated some how?
>>
>> There must be a way to get the original data before OSX / Cocoa "messes" with it.
>>
>> 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

References: 
 >NSReadPixel returning different colors (From: Richard Holliday <email@hidden>)
 >Re: NSReadPixel returning different colors (From: Andreas Mayer <email@hidden>)
 >Re: NSReadPixel returning different colors (From: Richard Holliday <email@hidden>)
 >Re: NSReadPixel returning different colors (From: John Stiles <email@hidden>)

  • Prev by Date: Tabs in NSTextList markers?
  • Next by Date: Re: Order of controls
  • Previous by thread: Re: NSReadPixel returning different colors
  • Next by thread: Checking for Spotlight
  • Index(es):
    • Date
    • Thread