zbl
zbl is a Rust and Python library for screen/window capturing on Windows. It provides an interface
to Windows.Graphics.Capture API with a focus on simplifying integrating computer vision applications for Windows Desktop apps.
This library is in early development stage. This means that it's only verified to work for a 'happy path' scenarios - beware of bugs!
Python
Installation
pip install zbl
Alternatively, you can install suitable wheel from releases page.
Usage
from zbl import Capture
with Capture(window_name='visual studio code') as cap:
# grab a single frame (numpy.ndarray) and print its shape
print(cap.grab().shape)
The snippet above will capture a window which title contains the string visual studio code,
grab one frame and print its shape.
See Capture for other API methods.
To run an example using OpenCV's highgui:
- Install
opencv-python - Run
python -m zbl --display-id 0
Rust
See examples. Note: if you are getting OpenCV build errors when building the example, check out how to build OpenCV rust bindings.
Comparison to mss / pyautogui
Both are very slow at the time of writing. mss tops at 30-50 fps in a tight loop, pyautogui is
even slower than that. zbl is able to capture an order of magnitude faster (at 500-700 fps). This allows a lot more time for the actual processing.
Credits
zbl is heavily inspired by screenshot-rs.
Release files for zbl 0.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| zbl-0.7.1-cp313-cp313-win_amd64.whl | CPython 3.13 | CPython 3.13 | Windows x86-64 | Details |
| zbl-0.7.1-cp312-cp312-win_amd64.whl | CPython 3.12 | CPython 3.12 | Windows x86-64 | Details |
| zbl-0.7.1-cp311-cp311-win_amd64.whl | CPython 3.11 | CPython 3.11 | Windows x86-64 | Details |
| zbl-0.7.1-cp310-cp310-win_amd64.whl | CPython 3.10 | CPython 3.10 | Windows x86-64 | Details |
| zbl-0.7.1-cp39-cp39-win_amd64.whl | CPython 3.9 | CPython 3.9 | Windows x86-64 | Details |
Total release size: 915.7 kB
Release files / zbl-0.7.1-cp313-cp313-win_amd64.whl
| Download URL | zbl-0.7.1-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 182.8 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a176d10c132917d2921869c11121074883987bfefceffca02af3bb53e92d9e0b
|
|
BLAKE2b-256 checksum How to use checksums |
1e61e711bd8f9a22998acb1254e81ac16150a7aabb5fd3a1f49a3e40f2f85147
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Release files / zbl-0.7.1-cp312-cp312-win_amd64.whl
| Download URL | zbl-0.7.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 182.9 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
fca35badbd1c509f809b1cf84178c9758cb727138d9ca2528b70adb3934a5b1d
|
|
BLAKE2b-256 checksum How to use checksums |
aee5b672e7ec482e427ebc21e546a45c1f1a9b8512bde7d9e8c701195f93a680
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Release files / zbl-0.7.1-cp311-cp311-win_amd64.whl
| Download URL | zbl-0.7.1-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 182.7 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
76c0b7782540afe233b16993aa1b3cdd76c0fee9876a6f476e2648f512ec03a2
|
|
BLAKE2b-256 checksum How to use checksums |
d4ec89d0ef4aeac3e0ae1cb542996a5d141bf81368d9253cebc8c13a12171974
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Release files / zbl-0.7.1-cp310-cp310-win_amd64.whl
| Download URL | zbl-0.7.1-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 182.7 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8cb34c30f803c9e82c39ad1da899908f12c1c00bc29241f0eacdd29ce31612f6
|
|
BLAKE2b-256 checksum How to use checksums |
462d5b6e247a3b9fc92cb405ab0614be3b60ea592ab764d3eb0daec8bbf18b4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Release files / zbl-0.7.1-cp39-cp39-win_amd64.whl
| Download URL | zbl-0.7.1-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 184.7 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1f1589a370b246dd6123a67f4b1ae8877b0b7be724cc8be47ddfccc6bfc26f9a
|
|
BLAKE2b-256 checksum How to use checksums |
a1df710580f312e9e7b231e5ee972918865f0ab37fe654140420f006b692e268
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|