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 channel not captured #152

Open
zhichaoh opened this issue Mar 23, 2020 · 1 comment
Open

Alpha channel not captured #152

zhichaoh opened this issue Mar 23, 2020 · 1 comment

Comments

@zhichaoh
Copy link

zhichaoh commented Mar 23, 2020

Hello,

RGBA values are ones sent by the underlying layer (the OS). MSS does not alter that data, so if that does not work for you, I am afraid there is nothing that can be done on the MSS level.

Originally posted by @BoboTiG in #151 (comment)

In the windows.py, the following comments seems to strip off the alpha channel data:

python-mss/mss/windows.py

Lines 237 to 242 in 229bd0b

[2] bmi.bmiHeader.biBitCount = 32
image_data = create_string_buffer(height * width * 4)
We grab the image in RGBX mode, so that each word is 32bit
and we have no striding, then we transform to RGB.
Inspired by https://github.com/zoofIO/flexx

What is the consideration here?

@BoboTiG
Copy link
Owner

BoboTiG commented Apr 13, 2020

You could use the bgra attribute. It keeps alpha values.

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

No branches or pull requests

2 participants