zbl


Namezbl JSON
Version 0.7.0 PyPI version JSON
download
home_pageNone
Summaryreal-time window capture library based on D3D11 and Windows.Graphics.Capture
upload_time2025-08-07 23:00:52
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords windows d3d11 window-capture graphics-capture cv
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # zbl

[![PyPI version](https://badge.fury.io/py/zbl.svg)](https://badge.fury.io/py/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](https://github.com/modelflat/zbl/releases).

### Usage

```python
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](https://github.com/modelflat/zbl/blob/master/zbl_py/zbl/__init__.py) 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](https://github.com/modelflat/zbl/tree/master/zbl/examples).
Note: if you are getting OpenCV build errors when building the example, check out [how to build OpenCV rust bindings](https://github.com/twistedfall/opencv-rust#rust-opencv-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](https://github.com/robmikh/screenshot-rs).


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "zbl",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "windows, d3d11, window-capture, graphics-capture, cv",
    "author": null,
    "author_email": null,
    "download_url": null,
    "platform": null,
    "description": "# zbl\r\n\r\n[![PyPI version](https://badge.fury.io/py/zbl.svg)](https://badge.fury.io/py/zbl)\r\n\r\n`zbl` is a Rust and Python library for screen/window capturing on Windows. It provides an interface\r\nto `Windows.Graphics.Capture` API with a focus on simplifying integrating computer vision applications for Windows Desktop apps.\r\n\r\n**This library is in early development stage**. This means that it's only verified to work for a 'happy path'\r\nscenarios - beware of bugs!\r\n\r\n## Python\r\n\r\n### Installation\r\n\r\n`pip install zbl`\r\n\r\nAlternatively, you can install suitable wheel from [releases page](https://github.com/modelflat/zbl/releases).\r\n\r\n### Usage\r\n\r\n```python\r\nfrom zbl import Capture\r\n\r\nwith Capture(window_name='visual studio code') as cap:\r\n    # grab a single frame (numpy.ndarray) and print its shape\r\n    print(cap.grab().shape)\r\n```\r\n\r\nThe snippet above will capture a window which title contains the string `visual studio code`,\r\ngrab one frame and print its shape.\r\n\r\nSee [Capture](https://github.com/modelflat/zbl/blob/master/zbl_py/zbl/__init__.py) for other API methods.\r\n\r\nTo run an example using OpenCV's `highgui`:\r\n\r\n1. Install `opencv-python`\r\n2. Run `python -m zbl --display-id 0`\r\n\r\n## Rust\r\n\r\nSee [examples](https://github.com/modelflat/zbl/tree/master/zbl/examples).\r\nNote: if you are getting OpenCV build errors when building the example, check out [how to build OpenCV rust bindings](https://github.com/twistedfall/opencv-rust#rust-opencv-bindings).\r\n\r\n## Comparison to `mss` / `pyautogui`\r\n\r\nBoth are very slow at the time of writing. `mss` tops at 30-50 fps in a tight loop, `pyautogui` is\r\neven 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.\r\n\r\n## Credits\r\n\r\n`zbl` is heavily inspired by [screenshot-rs](https://github.com/robmikh/screenshot-rs).\r\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "real-time window capture library based on D3D11 and Windows.Graphics.Capture",
    "version": "0.7.0",
    "project_urls": {
        "Homepage": "https://github.com/modelflat/zbl",
        "Repository": "https://github.com/modelflat/zbl"
    },
    "split_keywords": [
        "windows",
        " d3d11",
        " window-capture",
        " graphics-capture",
        " cv"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "66df69055a711af04a0fb2bf854b4515ff3618a9eb48feedc71e5a9238cc675f",
                "md5": "9ad35f5a6184f1096065e0d3719e4a55",
                "sha256": "bbea662be0afb88f09cffe517c9ed5ad18b78170a2495b240be8ca59765276a5"
            },
            "downloads": -1,
            "filename": "zbl-0.7.0-cp310-cp310-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "9ad35f5a6184f1096065e0d3719e4a55",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.9",
            "size": 186687,
            "upload_time": "2025-08-07T23:00:52",
            "upload_time_iso_8601": "2025-08-07T23:00:52.461330Z",
            "url": "https://files.pythonhosted.org/packages/66/df/69055a711af04a0fb2bf854b4515ff3618a9eb48feedc71e5a9238cc675f/zbl-0.7.0-cp310-cp310-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fd1e422f9229ece0868e3f5ca3de5ea11bdd2ca050a197c92f6906b6ee894270",
                "md5": "2a1ba1ed75f06bd6dc702c30005d0806",
                "sha256": "d34abd4521c350ffe1e659c333ea1ae099f9b39076d61003543b3413bd71e17c"
            },
            "downloads": -1,
            "filename": "zbl-0.7.0-cp311-cp311-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "2a1ba1ed75f06bd6dc702c30005d0806",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.9",
            "size": 186388,
            "upload_time": "2025-08-07T23:00:53",
            "upload_time_iso_8601": "2025-08-07T23:00:53.508763Z",
            "url": "https://files.pythonhosted.org/packages/fd/1e/422f9229ece0868e3f5ca3de5ea11bdd2ca050a197c92f6906b6ee894270/zbl-0.7.0-cp311-cp311-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3a2bc654c2fbea9e9cf28575f9c59bc712d6433873d14a7c48a2186cbe2814ab",
                "md5": "645f581ffb04f1ab7d7e27a2c7d77a82",
                "sha256": "3affd255ff73e6e46449876b3effbad53ee54d51907752d2e1bb34527a3471ce"
            },
            "downloads": -1,
            "filename": "zbl-0.7.0-cp312-cp312-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "645f581ffb04f1ab7d7e27a2c7d77a82",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.9",
            "size": 187395,
            "upload_time": "2025-08-07T23:00:54",
            "upload_time_iso_8601": "2025-08-07T23:00:54.398274Z",
            "url": "https://files.pythonhosted.org/packages/3a/2b/c654c2fbea9e9cf28575f9c59bc712d6433873d14a7c48a2186cbe2814ab/zbl-0.7.0-cp312-cp312-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "005da203125f5e2b0aa33998f81a79cf8cbc80e296b19b09494bfa5c95aa5298",
                "md5": "071d9cecb24921be10d2362ebb9c6d55",
                "sha256": "51e99224b6ef5cecb509256a6c1a4c56b82d6d682c473631cae7167fc99ad25e"
            },
            "downloads": -1,
            "filename": "zbl-0.7.0-cp313-cp313-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "071d9cecb24921be10d2362ebb9c6d55",
            "packagetype": "bdist_wheel",
            "python_version": "cp313",
            "requires_python": ">=3.9",
            "size": 186575,
            "upload_time": "2025-08-07T23:00:56",
            "upload_time_iso_8601": "2025-08-07T23:00:56.254343Z",
            "url": "https://files.pythonhosted.org/packages/00/5d/a203125f5e2b0aa33998f81a79cf8cbc80e296b19b09494bfa5c95aa5298/zbl-0.7.0-cp313-cp313-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2322f7af2edb34bd836a568847a691f8d5e3c3b987047b7fb4f7354014ce08e3",
                "md5": "dd6554b3a201ea7b5a2dadbb6064cad4",
                "sha256": "c73381975744858837c8cca6a5efbaeb08f732dbfc90b41d5f6eb97e04a670e8"
            },
            "downloads": -1,
            "filename": "zbl-0.7.0-cp39-cp39-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "dd6554b3a201ea7b5a2dadbb6064cad4",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.9",
            "size": 187469,
            "upload_time": "2025-08-07T23:00:57",
            "upload_time_iso_8601": "2025-08-07T23:00:57.508263Z",
            "url": "https://files.pythonhosted.org/packages/23/22/f7af2edb34bd836a568847a691f8d5e3c3b987047b7fb4f7354014ce08e3/zbl-0.7.0-cp39-cp39-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-07 23:00:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "modelflat",
    "github_project": "zbl",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "zbl"
}
        
Elapsed time: 0.69369s