Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpha blending issue #864

Open
frdbr opened this issue Jan 27, 2023 · 1 comment
Open

Alpha blending issue #864

frdbr opened this issue Jan 27, 2023 · 1 comment

Comments

@frdbr
Copy link

frdbr commented Jan 27, 2023

Alpha blending doesn't work properly leading to ill-blended artifacts in transitions. See example in Kdenlive bug report. Alpha blending can't be done properly in 8 bits uint because gamma needs to be decoded for alpha to mean occlusion as in the Porter & Duff paper. More information on wikipedia and youtube.

image

A possible solution would be to:

  1. Step one would be to use at least float16
  2. Then undo gamma for every RGB
  3. Then compose, then redo gamma on RGB

This report is compiled from information provided by @aurelienpierreeng here and here

@ddennedy
Copy link
Member

This is a road map set of items, works correctly, in Movit, and is not limited to a few places. Please be aware that converting all processing to work in linear RGB will change the behavior of many color-oriented filters essentially breaking compatibility if not done correctly and thus existing projects should not benefit from a change here. Fixing it also has a big impact on performance and so must be coupled with something that works well with GPU. Then to keep performance good while still having a decently large toolset of effects means many things need to be ported. But there is vast landscape of GPU technologies, and there should always be a multi-threaded CPU fallback that is not GPU emulation. So, this is a whole big can of worms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants