obsproject / obsproject/obs-studio
White image gets alpha blended as grey image
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 76.4k
- Forks
- 10.2k
- Avg merge
- 4d 23h
- Merged PRs (30d)
- 12
Description
Operating System Info
Windows 10
Other OS
No response
OBS Studio Version
28.0.3
OBS Studio Version (Other)
No response
OBS Studio Log URL
doesn't apply
OBS Studio Crash Log URL
No response
Expected Behavior
In https://github.com/obsproject/obs-studio/pull/6257 blending modes have been added. And it seems to indeed "mostly" (it does something, not the right thing) fix my issue with LiveSplit not properly being captured transparently. However I feel like there's still "something wrong". If you look at this image:

you'll notice that it's a white square that only contains white pixels. However the opaqueness changes from left being fully opaque to right being transparent. As far as I understand sRGB really is just a curve applied to the colors such that darker colors get more of the 8-bit available per channel as human vision is not actually linear and we can see changes in brightness in dark colors really well. So in the end sRGB often is approximated as pow(color, 2.2). However if we think about it, the RGB values in my image are fully white and thus it's pow(1.0, 2.2), i.e. RGB stays at (1, 1, 1). The alpha however is somewhere between 0 and 1 as it's a gradient, so with 0.5 or so you get pow(0.5, 2.2) = 0.21... but more importantly, it basically just moves the alpha somewhere else between 0 and 1. So in the end what we should see is an image that no matter whether you consider it to be sRGB or not, should look white, but the gradient may look a little different as things might be a little more or less opaque.
Current Behavior
But that's not at all what the blending method in OBS seems to do. Instead I'm getting a grey image:


Steps to Reproduce
- Add an image source.
- Select the linked image.
- Make sure "Apply alpha in linear space is deactivated"
- Put it above a white background.
Anything else we should know?
This is a clean reproducible continuation of: https://github.com/obsproject/obs-studio/issues/5674
Also: People in Discord are suggesting that SRGB and sRGB are two separate concepts and that this might be related. However no one was able to link a source nor was I able to find any.
This of course as in the previous issue is just a small part of a bigger blending problem in OBS that affects (more or less) all the sources.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with an image source over a white background and the “Apply alpha in linear space” option disabled. Review the blending-mode changes in PR 6257 and the related issue 5674, then compare the rendered white alpha gradient with the expected result. Done means white pixels remain white while their transparency varies without becoming grey.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- computer-graphics, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100