• 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: NSBitmapImageRep, precomputing alpha
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBitmapImageRep, precomputing alpha


  • Subject: Re: NSBitmapImageRep, precomputing alpha
  • From: Gregory Weston <email@hidden>
  • Date: Sat, 22 Dec 2001 22:17:44 -0500

On 12/22/01, Raphael Sebbe <email@hidden> wrote:

> I just would like to have the confirmation that when manually setting
> pixel colors of an NSBitmapImageRep with an alpha channel, you MUST
> manually premultiply the color components by the alpha value (per
> pixel). It took me hours to figure that out, debugging... Assuming this
> is correct, it should definitely appear in the doc.

It does. I remember being annoyed when I read that I'd have to do it myself. I'm
not sure how stable the docs have been since 10.0 shipped, but March'd be about
when I read it. You can find a couple of notes to this effect if you look for
"premultiply" or "premultiplied" in Apple's docs.

| A sample is data that describes one component of a pixel. In an RGB color
| system, the red, green, and blue components of a color are specified as
| separate samples, as are the cyan, magenta, yellow, and black components in a
| CMYK system. Color values in a gray scale are a single sample. Alpha values
| that determine transparency and opaqueness are specified as a coverage sample
| separate from color. In bitmap images with alpha, the color (or gray)
| components have to be premultiplied with the alpha. This is the way images
| with alpha are displayed, this is the way they are read back, and this is the
| way they are stored in TIFFs.

I'd agree that there should be more attention drawn to this in the
NSBitmapImageRep documentation.

G


  • Follow-Ups:
    • Re: precomputing alpha + color accuracy ?
      • From: Raphael Sebbe <email@hidden>
  • Prev by Date: Re: Saving/Opening Files - different under PB than with build of app
  • Next by Date: Re: Saving/Opening Files - different under PB than with build of app
  • Previous by thread: NSBitmapImageRep, precomputing alpha
  • Next by thread: Re: precomputing alpha + color accuracy ?
  • Index(es):
    • Date
    • Thread