Skip to main content

real-time window capture library based on D3D11 and Windows.Graphics.Capture

Project description

zbl

PyPI version

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:
    frame = next(cap.frames())
    print(frame.shape)

The snippet above will capture a window which title contains the string visual studio code, take one frame (which is represented as a numpy array) and print its shape.

See Capture constructor for more options. It is possible to capture the entire screen using display_id argument, for example.

To run an example using OpenCV's highgui:

  1. Install opencv-python
  2. 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

zbl-0.6.3-cp313-cp313-win_amd64.whl (186.5 kB view details)

Uploaded CPython 3.13Windows x86-64

zbl-0.6.3-cp312-cp312-win_amd64.whl (187.3 kB view details)

Uploaded CPython 3.12Windows x86-64

zbl-0.6.3-cp311-cp311-win_amd64.whl (187.2 kB view details)

Uploaded CPython 3.11Windows x86-64

zbl-0.6.3-cp310-cp310-win_amd64.whl (187.1 kB view details)

Uploaded CPython 3.10Windows x86-64

zbl-0.6.3-cp39-cp39-win_amd64.whl (187.6 kB view details)

Uploaded CPython 3.9Windows x86-64

File details

Details for the file zbl-0.6.3-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: zbl-0.6.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 186.5 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for zbl-0.6.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1b65c25fe5a783ed1c2ed0f0fb5e4d243d3f2fe0a6f8313b9ce2717e3f429bdf
MD5 df47de3fe9f65156389cfa7ac4a5e5f6
BLAKE2b-256 65190d826b3c2998a97e111780b112cf308e6190a534e08e234460fc020b1fd0

See more details on using hashes here.

File details

Details for the file zbl-0.6.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: zbl-0.6.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 187.3 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for zbl-0.6.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 089ce14c5e2cc4111b56b6892cc6c205c318262a2b0449889197677336bb3598
MD5 82da4f25d847cf60e5d3ecb9fdf4d43e
BLAKE2b-256 8cca268782fed4594411c0d623b8065adf3ccb469a7bb63eee20f2bf6eb90021

See more details on using hashes here.

File details

Details for the file zbl-0.6.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: zbl-0.6.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 187.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for zbl-0.6.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e8f52abbd3f857c934cafb9b93114d78ca6f3e6073ab20590f028d07e4fc281b
MD5 0f242add66fc0238bbfa4fc6fc36ae2d
BLAKE2b-256 7e5ce27be2150f0bd4fa0d6a05066116e2695d96ae32df339e08679b98d8ee9c

See more details on using hashes here.

File details

Details for the file zbl-0.6.3-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: zbl-0.6.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 187.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for zbl-0.6.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bcec49baff0b254512b1472beebeea6aa5d036d203da2ceaa483ab75d48d01e6
MD5 e0d3d507b854d28048b7e7fe7e594f0f
BLAKE2b-256 56178a0ecdb9bb34446158f5904c5f410f8885528b774a64b44a0fde160c56ab

See more details on using hashes here.

File details

Details for the file zbl-0.6.3-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: zbl-0.6.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 187.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for zbl-0.6.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 eaafebc0d9d59d59e92828f431d319286e817974bf8a0b0503de024743d38033
MD5 3945432f7d5a623f16b4d72b9a9bc147
BLAKE2b-256 71f8efdb10da0b8ee0d9358290b9d9cec9ab9a12dedc8b6af07bed09eee609a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page