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 (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com