• 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: Has My Image Been Premultiplied?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Has My Image Been Premultiplied?


  • Subject: Re: Has My Image Been Premultiplied?
  • From: Jason Harris <email@hidden>
  • Date: Fri, 21 Feb 2003 21:18:34 -0700

Scott Anguish Tried to Tell Me:

>> Here's the problem: sometimes it doesn't. I tested this with about 50
>> different images and found that about 90% of the time, the final image
>> was
>> premultiplied, but that 10% that isn't is the kicker.
>
> No, NSBitmapImageRep always premultiplies. If you need to work with
> unpremultiplied data, you have to use Quartz, specifically
> CGImageCreate with kCGImageAlphaLast.
>
> If you're seeing something other than that behavior, please send me
> some example code.


Actually, I can demonstrate this without using any code at all. Create a
new NIB that contains two image wells (both editable). Run the NIB - you
can now drag TIFF images into the image wells.

I dragged one of my problem-images into the left image well and used Pixie
to snap a blowup screenshot of it. Into the right image well, I dragged the
same image after having added a single pixel of fully masked red color.
Again, I snapped a blown up screenshot using Pixie.

Result - one premultiplied screenshot, one unpremultiplied screenshot. The
runtime is not premultiplying all incoming images.

All of the images and my test NIB are attached. I hope someone can shed
some light on this. I'd hate to have to override private API to fix this.

Jason Harris
Geekspiff

[demime 0.98b removed an attachment of type application/x-stuffit which had a name of Bad Premultiplication.sit"; x-mac-creator="53495421"; x-mac-type="53495435]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Has My Image Been Premultiplied? (From: Scott Anguish <email@hidden>)

  • Prev by Date: Easy question...?
  • Next by Date: Adding text attributes to current cursor position
  • Previous by thread: Re: Has My Image Been Premultiplied?
  • Next by thread: Cocoa w/Carbon Compile Warning
  • Index(es):
    • Date
    • Thread