winhdrshot
Windows HDR / SDR desktop screenshot library. Captures desktop frames via DXGI Desktop Duplication, normalizes them to linear scRGB, then encodes to PQ HDR AVIF.
Features
- DXGI Desktop Duplication (
IDXGIOutput5::DuplicateOutput1) capture, direct D3D11 texture readback - Three desktop formats supported:
R16G16B16A16_FLOAT(HDR scRGB, 16-bit float linear)R10G10B10A2_UNORM(HDR10 / Auto HDR, 10:10:10:2 packed)B8G8R8A8_UNORM(SDR 8-bit)
- Unified to linear scRGB float32
(H, W, 3) - scRGB → PQ (SMPTE ST 2084) → 10-bit AVIF, with CICP metadata (BT.709 primaries + PQ transfer)
Install
pip install winhdrshot
Usage
from winhdrshot import HDRScreenCapture, encode_scrgb_frame_to_avif, list_monitors
print(list_monitors())
with HDRScreenCapture(monitor_index=0) as cap:
scrgb = cap.grab_frame() # scRGB float32 (H, W, 3), HDR or SDR
avif_bytes = encode_scrgb_frame_to_avif(scrgb) # HDR AVIF bytes
open("out.avif", "wb").write(avif_bytes)
Dependencies
comtypes— COM interface callsd3dshot— comtypes declarations for DXGI / D3D11 interfacesimagecodecs— AVIF encoding (libavif), supports CICP metadatanumpy
Limitations
- Windows only (DXGI Desktop Duplication API)
- Requires a D3D11.0+ device
R10G10B10A2(HDR10) format clips HDR highlights to 1.0 — this is the inherent ceiling of 10-bit UNORM, not a bug; for the full HDR dynamic range the desktop must be inR16G16B16A16_FLOATmode- AVIF is lossy (lossless mode unavailable), so some color deviation is expected
- Color space: desktop duplication yields scRGB (BT.709 primaries + linear + (1,1,1)=80 nits), not BT.2020
License
AGPL-3.0-or-later
Metadata
Release files for winhdrshot 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| winhdrshot-0.1.0.tar.gz | 12.4 kB | Without provenance | Details for winhdrshot-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| winhdrshot-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for winhdrshot-0.1.0-py3-none-any.whl |
Total release size: 24.1 kB
Release files / winhdrshot-0.1.0.tar.gz
| Download URL | winhdrshot-0.1.0.tar.gz |
|---|---|
| Size | 12.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
85500b9d75811d7f72ef9dda3be558ad5d383ebfe24519e48e826c1b8e6b60a9
|
|
BLAKE2b-256 checksum How to use checksums |
0fc556bd589938117177f8d73ef3f0b985bf8ef458301389fafe9bfea1ff3a60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / winhdrshot-0.1.0-py3-none-any.whl
| Download URL | winhdrshot-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d949f8cfb35d8689c01ed49e953c0834dc6c9a9e6b780b604a91acaf01d25124
|
|
BLAKE2b-256 checksum How to use checksums |
365e436eeeff9947464167cc7801e7ad80ac31930ab8dc0cd3eea5fe3e4f8079
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for winhdrshot 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.