BoboTiG / python-mss

An ultra fast cross-platform multiple screenshots module in pure Python using ctypes.
https://pypi.org/project/mss/
MIT License
1.02k stars 93 forks source link

Grab screenshot including alpha channel (RGBA) ? #151

Closed AxKo closed 4 years ago

AxKo commented 4 years ago

I'm using Py3.6 under Windows10 and I try to use mss to get a screenshot that also includes the alpha channel.

I see that the image that comes back from grab() contains RGBA data and with PIL.Image.frombytes("RGBA", mssImage.size, mssImage.bgra, "raw", "BGRA") I can create a PIL image and save it as bmp file which contains an alpha channel. Photoshop displays the alpha channel, but it is empty.

So, is it possible to capture the alpha channel with mss ??

Many thanks,

BoboTiG commented 4 years ago

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.

AxKo commented 4 years ago

Hm, okay. Many thanks for the reply.