You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: libobs: a source set to Darken blending draws black where it is transparent (upstream #6591) #1404
Upstream bug: obsproject/obs-studio#6591, reported by SuslikV in June 2022. jpark37 and jw0z96, the author of the blend modes, agreed there that "there's still a bug here". It was closed in February 2023 as not planned. The forum has the same report (threads/source-blending-modes.148443, Darken noted as wrong for transparent images), where the workaround given is to re-export the image on a white background. Still present in this fork.
Location
libobs/obs-scene.c.h, obs_blend_mode_params[OBS_BLEND_DARKEN]: GS_BLEND_ONE for all four factors with GS_BLEND_OP_MIN.
Direct3D and OpenGL ignore the blend factors for MIN and MAX, so each channel becomes min(source, destination) on premultiplied colour. A transparent source pixel is (0, 0, 0, 0) and always wins: black in colour and 0 in alpha. Lighten (MAX) does not have the problem, because the background wins there.
Class
Wrong output: black areas in the program and recordings, and a hole in the scene's alpha (visible when the scene is nested or keyed).
How it is reached
Add an image with transparent areas (a PNG logo, an overlay), set its Blending Mode to Darken, and put it over any background.
Reproduced in the current release
v0.1.0-beta.20261014 AppImage, headless (private Xvfb, private D-Bus, fresh HOME), driven over obs-websocket. A light grey (209) colour source with a PNG over it whose left half is transparent and whose right half is opaque grey (128), then a scene screenshot:
Blend mode
Transparent half
Opaque half
Normal
209, 209, 209, alpha 1
128
Darken
0, 0, 0, alpha 0
128
Lighten
209, 209, 209, alpha 1
209
Multiply
209, 209, 209, alpha 1
104
Fix
Darken items always render through their item texture. Clear that texture to opaque white instead of transparent black for Darken, so the source is drawn over white: a transparent pixel then leaves the background, an opaque pixel is unchanged, and a partly transparent one is darkened as the image over white would be (the workaround users were given). PR follows.
@SuslikV you reported this in obsproject/obs-studio#6591: a source set to Darken blending drew black where it is transparent and cut a hole in the scene. That's fixed here in obs-rust by #1406, merged today with a regression test.
Darken uses the MIN blend op, and Direct3D and OpenGL ignore blend factors for MIN, so a transparent pixel (0, 0, 0, 0) always won. A Darken item is now drawn over opaque white in its item texture, so where it's transparent the minimum keeps the background, colour and alpha. Opaque pixels are unchanged, and partly transparent ones darken as the source over white would, which matches the re-export-on-white workaround. Only Darken items change.
Tested headless with a scene screenshot: a light grey background with a PNG over it, left half transparent and right half grey 128. With Darken, 0.1.0-beta.20261014 gave black with alpha 0 on the left. With the fix the left half keeps the background (209 grey, alpha 1), and the right half stays 128.
Activity
rdoupe commentedon Oct 18, 2026
Claiming: this issue. RED/GREEN are ready; PR follows once the full test run finishes.
test/cmocka: Add failing test for Darken over a transparent source
libobs: Draw Darken sources over white so transparency keeps the back…
libobs: Draw Darken sources over white so transparency keeps the back…
rdoupe commentedon Oct 18, 2026
@SuslikV you reported this in obsproject/obs-studio#6591: a source set to Darken blending drew black where it is transparent and cut a hole in the scene. That's fixed here in obs-rust by #1406, merged today with a regression test.
Darken uses the MIN blend op, and Direct3D and OpenGL ignore blend factors for MIN, so a transparent pixel (0, 0, 0, 0) always won. A Darken item is now drawn over opaque white in its item texture, so where it's transparent the minimum keeps the background, colour and alpha. Opaque pixels are unchanged, and partly transparent ones darken as the source over white would, which matches the re-export-on-white workaround. Only Darken items change.
Tested headless with a scene screenshot: a light grey background with a PNG over it, left half transparent and right half grey 128. With Darken, 0.1.0-beta.20261014 gave black with alpha 0 on the left. With the fix the left half keeps the background (209 grey, alpha 1), and the right half stays 128.
It will be in the next obs-rust daily release after 0.1.0-beta.20261018: https://github.com/obs-rust/obs-studio/releases (Windows, macOS and Linux builds; on Arch it's
obs-studio-rust-gitin the AUR). obs-rust is an AI-assisted fork of OBS, based on current OBS master, with extra bug fixes like this one.