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:
    # 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:

  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

If you're not sure about the file name format, learn more about wheel file names.

zbl-0.7.1-cp313-cp313-win_amd64.whl (182.8 kB view details)

Uploaded CPython 3.13Windows x86-64

zbl-0.7.1-cp312-cp312-win_amd64.whl (182.9 kB view details)

Uploaded CPython 3.12Windows x86-64

zbl-0.7.1-cp311-cp311-win_amd64.whl (182.7 kB view details)

Uploaded CPython 3.11Windows x86-64

zbl-0.7.1-cp310-cp310-win_amd64.whl (182.7 kB view details)

Uploaded CPython 3.10Windows x86-64

zbl-0.7.1-cp39-cp39-win_amd64.whl (184.7 kB view details)

Uploaded CPython 3.9Windows x86-64

File details

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

File metadata

  • Download URL: zbl-0.7.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 182.8 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.7.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a176d10c132917d2921869c11121074883987bfefceffca02af3bb53e92d9e0b
MD5 794a4fb12c3e0c00dfa9f7c3743a7918
BLAKE2b-256 1e61e711bd8f9a22998acb1254e81ac16150a7aabb5fd3a1f49a3e40f2f85147

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zbl-0.7.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 182.9 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.7.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fca35badbd1c509f809b1cf84178c9758cb727138d9ca2528b70adb3934a5b1d
MD5 81e8d91939eee64346568d4ca7f72489
BLAKE2b-256 aee5b672e7ec482e427ebc21e546a45c1f1a9b8512bde7d9e8c701195f93a680

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zbl-0.7.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 182.7 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.7.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 76c0b7782540afe233b16993aa1b3cdd76c0fee9876a6f476e2648f512ec03a2
MD5 56c99b2ca9544081186754232c989bb3
BLAKE2b-256 d4ec89d0ef4aeac3e0ae1cb542996a5d141bf81368d9253cebc8c13a12171974

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zbl-0.7.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 182.7 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.7.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8cb34c30f803c9e82c39ad1da899908f12c1c00bc29241f0eacdd29ce31612f6
MD5 c78e69cda48f11fc56c5364e8c23903a
BLAKE2b-256 462d5b6e247a3b9fc92cb405ab0614be3b60ea592ab764d3eb0daec8bbf18b4f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zbl-0.7.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 184.7 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.7.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 1f1589a370b246dd6123a67f4b1ae8877b0b7be724cc8be47ddfccc6bfc26f9a
MD5 1bb0513e227a237d640b0ef0606fd627
BLAKE2b-256 a1df710580f312e9e7b231e5ee972918865f0ab37fe654140420f006b692e268

See more details on using hashes here.

Supported by

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