Skip to content

fix: use BlendMode.Src for video frame rendering#194

Merged
kdroidFilter merged 1 commit into
masterfrom
fix/video-alpha-blending-issue-98
Apr 11, 2026
Merged

fix: use BlendMode.Src for video frame rendering#194
kdroidFilter merged 1 commit into
masterfrom
fix/video-alpha-blending-issue-98

Conversation

@kdroidFilter
Copy link
Copy Markdown
Owner

Summary

  • Use BlendMode.Src instead of default SrcOver when drawing video frames in drawScaledImage()
  • Windows Media Foundation outputs BGRA frames with alpha = 0x00, causing video to blend with the background and appear washed out on light themes
  • BlendMode.Src writes pixels directly without alpha blending, fixing the rendering on all backgrounds

Fixes #98

Test plan

  • Play a video on Windows with OS set to light mode — video should render at full opacity
  • Play a video on Windows with dark mode — no regression
  • Verify video playback on macOS and Linux — no regression
  • Test all ContentScale modes (Fit, Crop, FillWidth, etc.)

Video frames from Windows Media Foundation have alpha bytes set to 0x00.
With the default SrcOver blend mode, this causes the video to appear
washed out or nearly invisible on light backgrounds, as pixels blend
with the underlying surface color.

Using BlendMode.Src ensures video pixels fully replace the destination,
regardless of the alpha channel value.

Fixes #98
@kdroidFilter kdroidFilter merged commit 1f7f696 into master Apr 11, 2026
9 checks passed
@kdroidFilter kdroidFilter deleted the fix/video-alpha-blending-issue-98 branch April 11, 2026 21:17
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

Successfully merging this pull request may close these issues.

Video requires black background in order to work normally

1 participant