zbl


Namezbl JSON
Version 0.2.1 PyPI version JSON
download
home_page
Summaryreal-time window capture library based on D3D11 and Windows.Graphics.Capture
upload_time2024-03-10 21:03:25
maintainer
docs_urlNone
author
requires_python>=3.7
license
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. 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:
    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](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.

## Plans

- (in progress) Integration with `GpuMat`s & full on-GPU processing

## Credits

`zbl` is heavily inspired by [screenshot-rs](https://github.com/robmikh/screenshot-rs).


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "zbl",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "windows,d3d11,window-capture,graphics-capture,cv",
    "author": "",
    "author_email": "",
    "download_url": "",
    "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. 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    frame = next(cap.frames())\r\n    print(frame.shape)\r\n```\r\n\r\nThe 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.\r\n\r\nSee `Capture` constructor for more options. It is possible to capture the entire screen using `display_id` argument,\r\nfor example.\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## Plans\r\n\r\n- (in progress) Integration with `GpuMat`s & full on-GPU 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": "",
    "summary": "real-time window capture library based on D3D11 and Windows.Graphics.Capture",
    "version": "0.2.1",
    "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": "36fdc5f060f823d0f9245bd752428053a0c276ac30d0a9adb9711d0353b40918",
                "md5": "593c6c8cf49396c8e8357b2b6c3800ae",
                "sha256": "ec02b0f7fd66b608256940f25b623a6449c87482140b47678f4ab65f71f29747"
            },
            "downloads": -1,
            "filename": "zbl-0.2.1-cp310-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "593c6c8cf49396c8e8357b2b6c3800ae",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.7",
            "size": 183326,
            "upload_time": "2024-03-10T21:03:25",
            "upload_time_iso_8601": "2024-03-10T21:03:25.362342Z",
            "url": "https://files.pythonhosted.org/packages/36/fd/c5f060f823d0f9245bd752428053a0c276ac30d0a9adb9711d0353b40918/zbl-0.2.1-cp310-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dd69a8e66efde65b399d41b647fe9480d6a78b3865e4d4a14cb471f495b3fe81",
                "md5": "b1f519b5288fb4d2dc5a2c3dda12a1c3",
                "sha256": "1022b9ec9c4d90bcdc059f316b2af5578150e90c6ed462b87a5e0ce751a96ff3"
            },
            "downloads": -1,
            "filename": "zbl-0.2.1-cp311-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "b1f519b5288fb4d2dc5a2c3dda12a1c3",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.7",
            "size": 183666,
            "upload_time": "2024-03-10T21:03:27",
            "upload_time_iso_8601": "2024-03-10T21:03:27.331104Z",
            "url": "https://files.pythonhosted.org/packages/dd/69/a8e66efde65b399d41b647fe9480d6a78b3865e4d4a14cb471f495b3fe81/zbl-0.2.1-cp311-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "227e20cf975fb0bba921bb196881cf5142529927575c06ab0429a52ee627a3ce",
                "md5": "b606d6567010e9e3ec6f29005f2360a7",
                "sha256": "464e212a462f66b776ba8d50d0f2f382cc3d9d87b5ad02cd7f51ddc32b3dc681"
            },
            "downloads": -1,
            "filename": "zbl-0.2.1-cp312-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "b606d6567010e9e3ec6f29005f2360a7",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.7",
            "size": 183818,
            "upload_time": "2024-03-10T21:03:29",
            "upload_time_iso_8601": "2024-03-10T21:03:29.259465Z",
            "url": "https://files.pythonhosted.org/packages/22/7e/20cf975fb0bba921bb196881cf5142529927575c06ab0429a52ee627a3ce/zbl-0.2.1-cp312-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5ec1a5dbcbb7f49df46255542494a4d509ca61d0467817b732a6ee267044de24",
                "md5": "e93e687081fa9878248bd2224ea6b3ec",
                "sha256": "dbc2cb5adfc3b3adb8052e845fd372e8bb8e9ca32050c3703ddf07731566f28e"
            },
            "downloads": -1,
            "filename": "zbl-0.2.1-cp37-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "e93e687081fa9878248bd2224ea6b3ec",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7",
            "size": 183364,
            "upload_time": "2024-03-10T21:03:31",
            "upload_time_iso_8601": "2024-03-10T21:03:31.008759Z",
            "url": "https://files.pythonhosted.org/packages/5e/c1/a5dbcbb7f49df46255542494a4d509ca61d0467817b732a6ee267044de24/zbl-0.2.1-cp37-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "475975256f27fedadce7abadc904af27c2dd138392d3758a33f4eeeb1edcb033",
                "md5": "3002be0a6ea5207bd121a998a26abe2b",
                "sha256": "b6f5611891446e399adac846b246f3606e61a46fc9dd271c7699fe15cdeb3fa6"
            },
            "downloads": -1,
            "filename": "zbl-0.2.1-cp38-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "3002be0a6ea5207bd121a998a26abe2b",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.7",
            "size": 183816,
            "upload_time": "2024-03-10T21:03:32",
            "upload_time_iso_8601": "2024-03-10T21:03:32.289778Z",
            "url": "https://files.pythonhosted.org/packages/47/59/75256f27fedadce7abadc904af27c2dd138392d3758a33f4eeeb1edcb033/zbl-0.2.1-cp38-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7a53907432acafb6622d10a523b91853c16dde5add1be2f5c5a7406e4c7bc49c",
                "md5": "0ec0fa73f9fe952dd547bf9b3d7abf0a",
                "sha256": "e47bef632c7ccfe48f0a460ec08ccacc357af3a39cf516aeb4b7ee564bdc89ef"
            },
            "downloads": -1,
            "filename": "zbl-0.2.1-cp39-none-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "0ec0fa73f9fe952dd547bf9b3d7abf0a",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.7",
            "size": 183611,
            "upload_time": "2024-03-10T21:03:34",
            "upload_time_iso_8601": "2024-03-10T21:03:34.122093Z",
            "url": "https://files.pythonhosted.org/packages/7a/53/907432acafb6622d10a523b91853c16dde5add1be2f5c5a7406e4c7bc49c/zbl-0.2.1-cp39-none-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-10 21:03:25",
    "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.20904s