Skip to content

renderer: refactor alpha handling

Niklas Haas requested to merge alpha_blending_v2 into master

Make the renderer hyper-conscious of whether alpha channels are currently premultipled or independent alpha, and go back and forth as needed.

Generally, we want premultiplied alpha for any type of filtering/blending operation, but independent alpha for any type of color processing. So we're forced to go back and forth. Fixes several issues related to overlay blending, especially for absolute color scale curves (which really, really do not play well with premultiplied alpha).

Also solves some edge cases related to transparent YCbCr content, combining independent alpha sources with custom conversion LUTs, etc.

Merge request reports