Re: NSBitmapImageRep getPixel and color Spaces
Re: NSBitmapImageRep getPixel and color Spaces
- Subject: Re: NSBitmapImageRep getPixel and color Spaces
- From: Daniel Vollmer <email@hidden>
- Date: Thu, 2 Mar 2006 20:03:51 +0100
On 02.03.2006, at 10:37, Heinrich Giesen wrote:
On 02.03.2006, at 01:11, Daniel Vollmer wrote:
For reference, the file I am using for testing is a grayscale PNG
image with 8bpp and the info panel displays the color-space as
"Calibrated Gray Colorspace", the created NSBitmapImageRep which I
fill with data and display is using NSCalibratedWhiteColorSpace.
The data in the PNG data (or PNG file) are NOT alpha premultiplied
and not gamma corrected. After creating an imageRep with
imageRep = [[NSBitmapImageReg alloc] initWithData:pngData]; (typo
in your mail?)
Yes, I was writing the mail from memory after having shut down Xcode
for the day. :)
or
imageRep = [NSBitmapImageReg imageRepWithData:pngData]
the pixels in the corresponding bitmapData are alpha premultiplied
but not gamma corrected.
That's what I was hoping for, as getting at the original unprocessed
data would be best.
The difference is the difference between no gamma correction (raw
data)
and gamma correction (raw data after rendering).
That was exactly the case; after I set the gamma (and the ColorSync
profile but that was identical for that particular image) for the
recreated image, Preview.app and my application display the image
identically.
In the end I will still display the image "incorrectly" (as the
application saves into a custom format without support for gamma /
color profiles and the application I am writing is supposed to
"preview" that format), but now I know where the difference comes from!
Heinrich Giesen
Thank you for the exhaustive and clear reply.
Daniel.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden