Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For another nice discussion of this topic, see this older publication by Blinn (yes that Blinn): https://courses.cs.washington.edu/courses/cse576/03sp/readin...

In this older terminology, pre-multiplied alpha is called associated alpha. He goes through the math, but a key takeaway is: "... downsampling and, in fact, all filtering operations should operate on arrays of associated pixel colors ..."

I really enjoy Blinn's articles (and iq's :).



One reason “associated alpha” is a better name is that it allows doing useful things with images where the alpha isn't correlated to the colour. In the simplest example, you have zero alpha but you have non-zero (non-black) colour. That gives you a pure additive blending effect! But you can arbitrarily choose your alpha values, so you can choose how much occlusion you want and how much added light. Classic non-premultiplied alpha has none of this power.

I wish I could find the article I read that argued for this. It had a lovely demonstration of how you could use this to combine fire and smoke effects into a single texture (smoke occludes but fire effects tend not to).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: