Skip to content

HinTak/skia-python-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI

linux testing

windows testing

This repository contains examples demonstrating the use of Skia-Python, a Python binding for the Skia graphics library. If you're interested in learning or exploring Skia-Python, this repository offers practical examples to get started.

On Wayland-based platforms (i.e. very new Linux systems), setting SDL_VIDEODRIVER=x11 may be needed for the SDL example; the equivalent for the GLUT example is PYOPENGL_PLATFORM=glx (not needed on Fedora 40 Wayland).

The skparagraph-example example generates the below as an example of multilingual paragraph layout. Note on Linux, it is highly sensitive to locale, and you might need to unset LANG and FC_LANG if you have unusual (non-English) settings.

test-en

SkSL_ShaderMulti+SDL2.py is a port of the animation on https://shaders.skia.org/ . Run it with a number argument (0 to 6) for the 7 examples on https://shaders.skia.org/ .

SkSL examples

original:

original

SkSL_CoordinateSpaces.py:

CoordinateSpaces

SkSL_EvaluatingImageShader.py (swap red and blue):

EvaluatingImageShader

SkSL_EvaluatingTwoShaders.py (Image with Gradient):

EvaluatingTwoShaders

SkSL_EvaluatingNestedShaders.py (Image with same Gradient as shader too):

EvaluatingNestedShaders

SkSL_MinifiedSkSL.py: (this is not a separate SkSL example, but how to generate Minified SkSL with Skia's minifier tool for the same result as SkSL_PremultipliedAlpha.py below):

MinifiedSkSL

SkSL_PremultipliedAlpha.py:

PremultipliedAlpha

SkSL_LinearSRGB.py:

LinearSRGB

SkSL_Uniforms.py:

Uniforms

SkSL_RawImageShaders.py:

RawImageShaders

About

Skia-python examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published