Re: Reading RGBA pixel values from image on disk
Re: Reading RGBA pixel values from image on disk
- Subject: Re: Reading RGBA pixel values from image on disk
- From: Quincey Morris <email@hidden>
- Date: Thu, 10 Mar 2011 13:17:51 -0800
On Mar 10, 2011, at 12:47, Seth Willits wrote:
> On Mar 10, 2011, at 7:18 AM, Leonardo wrote:
>
>> I read the imageRep with imageRepWithContentsOfFile and
>> get the RGBA values with "colorAtX: y:"
>
> Have you not yet discovered how excruciatingly slow that is?
Not to mention that recovering RGB values by "un-premultiplying" 8-bit integer component values is going to produce awful results. The loss of precision in the calculation is going to be something like 0.4% (1/256), not so bad, except that when alpha values are involved the error is actually whatever percentage 1/alpha works out to. Plug an alpha value like 32/256 into that calculation, and you'll see that partially transparent pixels will color shift significantly after un-premultiplication, compared to adjacent pixels of the same color. Worse, the color shift will vary across the image according the amount of transparency at each pixel.
_______________________________________________
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