Registry / serialization / skia-python

skia-python

JSON →
library144.0.post2pypypi✓ verified 85d ago

Python bindings for the Skia 2D graphics library. Current version is 144.0.post2, released on 2025-04-28. The project tracks upstream Skia milestones (currently m144) and releases irregularly, often with significant API changes between milestones.

pip install skia-python
INSTALL
IMPORT
SIG · SKIA-PYTHON
S
skia-python
serializationpythonv144.0.post2
Install
4.5s avg
Import
Disk
120MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v144.0.post2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.5s · import 0.000s · 119MB
120MB installed
● package 120MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

skia
import skia

Basic example: create a surface, draw a red rectangle, and save as PNG.

import skia import os # Create 256x256 red canvas surface = skia.Surface(256, 256) with surface as canvas: paint = skia.Paint(color=skia.ColorRED, style=skia.Paint.kFill_Style) canvas.drawRect(skia.Rect(10, 10, 100, 100), paint) # Save to PNG image = surface.makeImageSnapshot() image.save('output.png', skia.kPNG) print('Image saved as output.png')
Debug
Known issues
breakingVulkan APIs now require skia.VkFormat and skia.VkImageLayout enums instead of integer constants. Code using raw Vulkan integer values will break.
fix
Replace integer values with skia.VkFormat.* and skia.VkImageLayout.*, e.g. skia.VkFormat.kR8G8B8A8_UNORM_VK_FORMAT.
affects: >=138.0
breakingskia.ApplyPerspectiveClip removed upstream. Associated APIs take one fewer argument.
fix
Remove the perspective clip argument from affected API calls. Check Skia release notes for exact API changes.
affects: >=138.0
breakingskia.PathBuilder.incReserve now takes one more argument (count plus unknown parameter).
fix
Add the extra argument to incReserve calls. Refer to Skia upstream docs for new signature.
affects: >=138.0
gotchaLinux users must have libEGL.so installed (from mesa-libEGL, libglvnd, or Nvidia drivers) or import will fail.
fix
Install mesa-libEGL (e.g., sudo apt install libegl1 on Debian/Ubuntu) or ensure libEGL.so is in library path.
affects: >=87.9rc1, >=138.0rc1
deprecatedskia.PDF.MakeDocument() signature changed: jpegEncoder and jpegDecoder fields are now required in Metadata. The zero-argument skia.PDF.Metadata() now includes default JPEG codecs.
fix
Use skia.PDF.Metadata() without arguments for defaults, or supply jpegEncoder/jpegDecoder callables.
affects: >=136.b13
gotchaNumpy dependency is required; missing numpy leads to import errors in pixel operations.
fix
Install numpy: pip install numpy
affects: all
Errors
Common errors & fixes
ImportError: libEGL.so.1: cannot open shared object file: No such file or directory
Missing libEGL shared library on Linux. Required since v87.9rc1/v138.0rc1.
fix
Install libegl1 (Ubuntu/Debian: sudo apt install libegl1, Fedora: sudo dnf install mesa-libEGL)
AttributeError: module 'skia' has no attribute 'ApplyPerspectiveClip'
ApplyPerspectiveClip removed in Skia m138+.
fix
Remove references to skia.ApplyPerspectiveClip and adapt code to use fewer arguments in related APIs.
TypeError: incReserve() takes 2 positional arguments but 3 were given
skia.PathBuilder.incReserve signature changed: now takes an extra argument.
fix
Check Skia docs for new signature (likely incReserve(self, count, extra)). Pass the required additional argument.
ModuleNotFoundError: No module named 'numpy'
numpy is a required dependency for pixel operations and image I/O.
fix
Install numpy: pip install numpy
skia.pdf: Metadata() got an unexpected keyword argument 'jpegEncoder'
Old code passing jpegEncoder to Metadata() constructor; new Metadata() initializes with default codecs.
fix
Use skia.PDF.Metadata() without arguments and set jpegEncoder/jpegDecoder as attributes if needed.
Upgrade
Version history
144.0.post2latest on PyPI · released Mar 19, 2026
Audit
Dependencies
numpyrequiredRequired for pixel buffer operations and array conversion
Agent activity
16 hits · last 30 days
node
12
Resources
skia-python — pip install skia-python · libregistry