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
feat: Change the ScreenShot API to be buffer-oriented. (#521)
This implements many of the changes discussed in #476, part 1. It
does not make the ScreenShot object itself accessible as a buffer;
that's a separate matter.
This change makes `_raw` (previously `raw`) private. `_raw` is now
the original object passed in.
The `bgra` and `rgb` properties now return `memoryview` objects,
rather than `bytes` or `bytearray` objects. This means that the
backends can now capture data to an OS-provided buffer, such as one
provided by `mmap` or `CreateDIBSection`. The `ScreenShot` object can
then give the user direct access to this buffer, without ever needing
to copy the data.
Similarly, ScreenShot objects now can be given their data as any
buffer type, not just a bytearray.
The backends haven't yet been changed to take advantage of these new
features.
Docs, examples, and demos are updated.
Copy file name to clipboardExpand all lines: docs/source/release-history/v11.0.0.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,19 @@ Release date: 2026-xx-x
8
8
9
9
## Highlights
10
10
11
+
### API changes
12
+
13
+
The API changes discussed in the 10.2 release notes are now implemented. (They're not all implemented as of this
14
+
writing, but should be by the time we release 11.0!)
15
+
16
+
#### ScreenShot attributes
17
+
18
+
The :py:attr:`mss.ScreenShot.raw` attribute has been removed. Use the :py:attr:`mss.ScreenShot.bgra` property instead.
19
+
20
+
The :py:attr:`mss.ScreenShot.bgra` and :py:attr:`mss.ScreenShot.rgb` properties now will return read-only bytes-like
21
+
:py:type:`memoryview` objects, not necessarily :py:type:`bytes` or :py:type:`bytearray` objects. For practical use
22
+
cases, this should not be noticible. This change was allows faster access to screenshot data, with fewer memory copies.
23
+
11
24
### Python 3.9 EOL
12
25
13
26
Python 3.9 reached [end-of-life](https://devguide.python.org/developer-workflow/development-cycle/index.html#end-of-life-branches) on [October 31, 2025](https://devguide.python.org/versions/). It is no longer receiving any updates, even security updates.
0 commit comments