Blend2D Python Bindings (nanobind version)
Python bindings for the Blend2D rendering engine using nanobind.
Overview
This project has been converted from the original Cython-based implementation to use nanobind, which offers:
- Improved performance
- Better compatibility with modern C++
- Simplified binding code
- Cleaner implementation
Requirements
- C++17 compatible compiler
- CMake 3.15 or newer
- Python 3.8 or newer
- NumPy
Installation
From PyPI
Pre-built wheels are available for:
- Windows (x86_64)
- macOS (x86_64, arm64/Apple Silicon)
- Linux (x86_64, aarch64/ARM64)
- WebAssembly (via Emscripten)
pip install blend2d-python
From Source
pip install .
Or for development:
pip install -e .
Usage
import numpy as np
from blend2d import Context, Image, Gradient, Path, Format
# Create an image
img = Image(480, 480, Format.PRGB32)
# Attach a rendering context to it
ctx = Context(img)
# Clear the image with white color
ctx.fill_all((1.0, 1.0, 1.0, 1.0))
# Create a linear gradient
gradient = Gradient.create_linear(0, 0, 480, 480)
gradient.add_stop(0.0, (1.0, 0.0, 0.0, 1.0))
gradient.add_stop(0.5, (0.0, 1.0, 0.0, 1.0))
gradient.add_stop(1.0, (0.0, 0.0, 1.0, 1.0))
# Create a path (a star, for example)
path = Path()
path.move_to(240, 80)
for i in range(5):
angle = (i * 2.0 * np.pi / 5.0) + np.pi / 2.0
path.line_to(240 + 160 * np.cos(angle), 240 + 160 * np.sin(angle))
# Fill the path with the gradient
ctx.set_fill_style(gradient)
ctx.fill_path(path)
# Save the image to a file
img.write_to_file("star.png")
Building Wheels
This project uses cibuildwheel to build wheels for multiple platforms:
- Windows (x86_64)
- macOS (x86_64, arm64/Apple Silicon)
- Linux (x86_64, aarch64/ARM64)
- WebAssembly (via Emscripten)
To build wheels locally:
pip install cibuildwheel
python -m cibuildwheel --platform auto
License
MIT License
Acknowledgements
This project was originally created by John Wiggins using Cython, and has been converted to use nanobind.
Metadata
Release files for blend2d-python 1.0.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 |
|---|---|---|---|---|
| blend2d_python-1.0.0.tar.gz | 3.6 MB | With provenance | Details for blend2d_python-1.0.0.tar.gz |
Built distributions (wheels)
Total release size: 44.3 MB
Release files / blend2d_python-1.0.0.tar.gz
| Download URL | blend2d_python-1.0.0.tar.gz |
|---|---|
| Size | 3.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a88b1681568873266b39aefdc3b68023966c8ecbbbe6d8fe29d80a7dad28ee2b
|
|
BLAKE2b-256 checksum How to use checksums |
685f61a3df420487aff791639d069f849919041bcb94e7bf1184d6e70ff6769f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logRelease files / blend2d_python-1.0.0-cp312-cp312-win_amd64.whl
| Download URL | blend2d_python-1.0.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e6ba6330e3d3bdb3fd0e507703c609c4a43e5f386aca5b216017fbfa6c276bbe
|
|
BLAKE2b-256 checksum How to use checksums |
8aae4341284fd9bfa445c1f19d2c8013a04f4fbdd15d3ba495a7a07e12784c69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logRelease files / blend2d_python-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | blend2d_python-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
07259957415ab717fbe5d51afd774b0fa973ce7e2e5ff935862ec5fb607a8662
|
|
BLAKE2b-256 checksum How to use checksums |
acbe60fd1a4523d9c90c6d4768d9b057f6afbba95e24f4d5072370ff8e8f20e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logRelease files / blend2d_python-1.0.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | blend2d_python-1.0.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.12 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
76d70f5ff6eada3a95c4e85bceaf0c8c51bdd2cc37c0876178d73dbafeaa85c4
|
|
BLAKE2b-256 checksum How to use checksums |
5b9ab21153958f5c707c401413075ed692ed609f25ebc04fb81af5bdbb78c395
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logRelease files / blend2d_python-1.0.0-cp311-cp311-win_amd64.whl
| Download URL | blend2d_python-1.0.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
c507b38a88f9edf28545d72d190273eab5ed4dd4800d5a147ddcf35c15669eea
|
|
BLAKE2b-256 checksum How to use checksums |
9789e3d4116cfa42ed0e65572bce0cb2743a664338ca70fe672bebc54236ad65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logRelease files / blend2d_python-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | blend2d_python-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
b3f34b7b118234932377168032a5ed64dc5d785d2dcc406d42e74af36e8339ff
|
|
BLAKE2b-256 checksum How to use checksums |
b5e5ff4373918b98cffdaa670cd8fd3eae56490a0ad571f4473ab4bfc505fd85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logRelease files / blend2d_python-1.0.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | blend2d_python-1.0.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
df448af6aeafde03cb0bb431f1809797cfe9839dde46ed5ddbe05fed36bb3a29
|
|
BLAKE2b-256 checksum How to use checksums |
37a4300ad0eb6a8f510e0ed5fb15a60357e488ff39da1c2a26d90e37dc493ea7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logRelease files / blend2d_python-1.0.0-cp310-cp310-win_amd64.whl
| Download URL | blend2d_python-1.0.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f8bde34b1728f017297aa23461c5a8a89b08c0705fbf7f3912128eabea52ffb7
|
|
BLAKE2b-256 checksum How to use checksums |
f4a1be249591b95a089e7f9b14e39016c0cc6f2677cbd20876e3ca5d6b7cc153
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logRelease files / blend2d_python-1.0.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | blend2d_python-1.0.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
56822d6d5e244024d3f50b552d8bfdd1402c7d7db93e072cda4c751c78924f38
|
|
BLAKE2b-256 checksum How to use checksums |
0eebd7a155c3d97b9ca9d5c8e587894be7cb9ad3a9265da24a3f426c4e3a1f60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logRelease files / blend2d_python-1.0.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | blend2d_python-1.0.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.10 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
c6b4f0c7466f8a32c6c81c57387f423ddac95afdcecca17294f91e038ca5a8cc
|
|
BLAKE2b-256 checksum How to use checksums |
ce1b6591af550057112480216f3c8390035640fd74729192491caf36080ba942
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logRelease files / blend2d_python-1.0.0-cp39-cp39-win_amd64.whl
| Download URL | blend2d_python-1.0.0-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 3.0 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9ed4f213f750e534b78952240112dd44e72d14d5b98842ddcb2c85f915762fa8
|
|
BLAKE2b-256 checksum How to use checksums |
5e213962d9f3ff5543b678af11fd61bf8c039b7e2366e8ae3fa37224da61fd31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logRelease files / blend2d_python-1.0.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | blend2d_python-1.0.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.9 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c11ae24d4cdd2a1ff8792f809ecaf9a808b70e5194d01fda462c2583e3a75e4c
|
|
BLAKE2b-256 checksum How to use checksums |
5612cba682736d1552fad373c0fae8b62b314e89b2fe7bb34745611e9f556243
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logRelease files / blend2d_python-1.0.0-cp39-cp39-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | blend2d_python-1.0.0-cp39-cp39-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.9 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
10da925f249fdc7749c888450263b2c47d075bfb58f6e7880f965163b67c2a54
|
|
BLAKE2b-256 checksum How to use checksums |
01d8ef06534a023b9a4db973fe32701cd602080bb29fdbc4490c086482273711
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logRelease files / blend2d_python-1.0.0-cp38-cp38-win_amd64.whl
| Download URL | blend2d_python-1.0.0-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
019ee7544a4aded8504192ca697f2e9cc14a0287cbd8bb37f8bb61d41f3b41a9
|
|
BLAKE2b-256 checksum How to use checksums |
44a54ca4d5d5ab3bfb0f1c72158ee56e16b21676d71d4f757c36b7e49f727785
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logRelease files / blend2d_python-1.0.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | blend2d_python-1.0.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.8 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
55d3da53a62b7744ec9c0f30900b0618863b8af9197bde82cd946e0efa7e4daa
|
|
BLAKE2b-256 checksum How to use checksums |
b493159d5b85fd64350ca463417dbcffab6656db053d5627c0aafd5b1bdacbd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logRelease files / blend2d_python-1.0.0-cp38-cp38-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | blend2d_python-1.0.0-cp38-cp38-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.8 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
a58bf2ef4673bdeb78abc63a9e1b5bd32a8cbfc64b5555fb9206a8dd6fd6f4e0
|
|
BLAKE2b-256 checksum How to use checksums |
33f47efad1d03ebbb77c8f2294ae9d5cc6b0ebc59e790525f22b426e2a352d2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logSecurity for blend2d-python 1.0.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.
Full provenance
All 16 files in this release have been uploaded with provenance metadata.
Attestation for blend2d_python-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2025.
Transparency logA 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.