Python binding to Skia Graphics Library.
- Binding based on pybind11.
Binary package is available on PyPI:
pip install skia-python
Supported platforms: Python 3.8-3.13 (CPython) on
- Linux x86_64, aarch64
- macOS x86_64, arm64
- Windows x86_64, arm64 ; arm64 for the windows 11 and Python 3.11-3.13 combination only.
IMPORTANT: Starting v87.9rc1 / v138.0rc1, libEGL.so
(from mesa-libEGL, libglvnd, or your graphic
card's vendor e.g. NVidia) is required to be present on Linux hosts. This is associated
with the general change on Linux from X11 to Wayland, and from GTK3 to GTK4. Firefox started
to use it in 2021 (instead of the older libGLX.so
), so it is likely newer Linux systems
already have it, but please check. skia-python v87.9 / v138.0+ supports hardware acceleration
via both GLX (still the default under X11) and EGL (newly added).
For Linux platforms, there must be OpenGL, libEGL and fontconfig installed.
Current Ubuntu needs libegl1
(and libegl-mesa0
); on older Ubuntu the package names are
libglvnd0
and libgl1-mesa-egl
:
apt-get install libfontconfig1 libgl1-mesa-glx libgl1-mesa-egl libegl1 libglvnd0 libgl1-mesa-dri
Or:
yum install fontconfig mesa-libGL mesa-libEGL libglvnd-egl mesa-dri-drivers
For unsupported environment, check the build instruction.
- Showcase
- Canvas Overview
- Canvas Creation
- Path Overview
- Paint Overview
- Python Image I/O
- Drawing Texts
https://kyamagu.github.io/skia-python
-
For breaking changes and tips on migration from
m87
: See Migration Guide, also see the detailed changes below, especially README.m116. -
For information about changes after
m116
: README.m116, README.m117, README.m118, README.m119, README.m120, README.m121, README.m122, README.m123, README.m124, README.m125, README.m126, README.m127, README.m128, README.m129, README.m130, README.m131, README.m132, README.m133, README.m134, README.m135, README.m136, README.m137, README.m138.
Feel free to post an issue or PR.