28:00 I think the essential difference here is that the interpolation during upsampling should take into account of the different alphas of samples, not just average colors and alphas separately. This is why in non premultiplied image, the green part with 0 alpha happens to "disrupt" the blue colors on the edge, which makes it looks weird. If we do premultiplied alpha, the green color get multiplied by 0 so upsampling did not pick up any green. Essentially, the upsampling interpolation should use alpha as weighted average and premultipling alpha achieves this.
Took me a while to get the premultiplied alpha working in my implementation. My issue was that I didn't realize that to get the final color output to the screen, you simply take C without any division, that's because the background black has an alpha of 1, which causes the alpha of C to also be 1, so a division of 1 is unnecessary.
Am I right that premultiplied and non-premultiplied alpha give the same result if the starting (say background) alpha is 1? But that another advantage of premultiplied over non-premultiplied, is that premultiplied is associative, but non-pre is not? Basically non-pre only really makes sense if the total alpha is 1, i.e. it can correctly do an over operation of a thing with alpha, over an opaque thing. But premultiplied, is able to combine two transparent things into a transparent thing that works just like the combination. Anyway, this is as far as combining things (which doesnt seem like such a big difference coz one could imitate premul by doing non-premul and dividing by alpha after every step?), but premul has the extra advantages when inter or extra polating, which is nice!
28:00 I think the essential difference here is that the interpolation during upsampling should take into account of the different alphas of samples, not just average colors and alphas separately. This is why in non premultiplied image, the green part with 0 alpha happens to "disrupt" the blue colors on the edge, which makes it looks weird.
If we do premultiplied alpha, the green color get multiplied by 0 so upsampling did not pick up any green.
Essentially, the upsampling interpolation should use alpha as weighted average and premultipling alpha achieves this.
I can't agree more, the diff comes from the interpolation, premultiplied img is just filtering the diff
At 28:13, If you look closely, there is still a little bit of fringe color on the pre-multiplied version, only this time it's black.
Thanks again for this Keenan :)
Took me a while to get the premultiplied alpha working in my implementation. My issue was that I didn't realize that to get the final color output to the screen, you simply take C without any division, that's because the background black has an alpha of 1, which causes the alpha of C to also be 1, so a division of 1 is unnecessary.
Very good tutorial nonetheless, it's pretty hard to find explanation on how these seemingly basic algorithm work on a low-level. Thanks!!
It is so good, so clear as usual, thx man!
Am I right that premultiplied and non-premultiplied alpha give the same result if the starting (say background) alpha is 1?
But that another advantage of premultiplied over non-premultiplied, is that premultiplied is associative, but non-pre is not?
Basically non-pre only really makes sense if the total alpha is 1, i.e. it can correctly do an over operation of a thing with alpha, over an opaque thing.
But premultiplied, is able to combine two transparent things into a transparent thing that works just like the combination.
Anyway, this is as far as combining things (which doesnt seem like such a big difference coz one could imitate premul by doing non-premul and dividing by alpha after every step?), but premul has the extra advantages when inter or extra polating, which is nice!
I also thought the same. So I think you right
nice tutorial, thank you
thank you
this class is pure torture so hard