From 20e5c014efbf7a060f86dffb5c94803cc8091f9e Mon Sep 17 00:00:00 2001 From: Ty Date: Thu, 3 Jul 2025 21:23:11 -0700 Subject: [PATCH] PlaylistView: support alpha channel in background images --- src/playlist/playlistview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/playlist/playlistview.cpp b/src/playlist/playlistview.cpp index eb202bc1e..9035d23cb 100644 --- a/src/playlist/playlistview.cpp +++ b/src/playlist/playlistview.cpp @@ -1468,10 +1468,10 @@ void PlaylistView::set_background_image(const QImage &image) { } if (!background_image_.isNull()) { - // Apply opacity filter + // Apply opacity filter: scale (not overwrite!) the alpha channel uchar *bits = background_image_.bits(); for (int i = 0; i < background_image_.height() * background_image_.bytesPerLine(); i += 4) { - bits[i + 3] = static_cast((opacity_level_ / 100.0) * 255); + bits[i + 3] = static_cast(bits[i + 3] * (opacity_level_ / 100.0)); } if (blur_radius_ != 0) {