• 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: Reading RGBA pixel values from image on disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Reading RGBA pixel values from image on disk (From: Leonardo <email@hidden>)
 >Re: Reading RGBA pixel values from image on disk (From: Seth Willits <email@hidden>)

  • Prev by Date: Re: Reading RGBA pixel values from image on disk
  • Next by Date: Re: Reading RGBA pixel values from image on disk
  • Previous by thread: Re: Reading RGBA pixel values from image on disk
  • Next by thread: Testing apps on Mac OS X 10.5
  • Index(es):
    • Date
    • Thread