https://github.com/micycle1/processing-skia
Eases Skija (Skia for Java) interoperability with Processing
https://github.com/micycle1/processing-skia
processing processing4 skia skija
Last synced: 7 months ago
JSON representation
Eases Skija (Skia for Java) interoperability with Processing
- Host: GitHub
- URL: https://github.com/micycle1/processing-skia
- Owner: micycle1
- Created: 2020-11-20T19:27:36.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-11-11T16:42:13.000Z (about 4 years ago)
- Last Synced: 2025-04-28T12:57:33.742Z (9 months ago)
- Topics: processing, processing4, skia, skija
- Language: Java
- Homepage:
- Size: 7.88 MB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# processing-skia
**Skia** is an open source 2D graphics library which provides common APIs that work across a variety of hardware and software platforms.
**Skija** provides high-quality Java bindings for Skia.
**processing-skia** does the backend work of setting Skija's render target to Processing, so you can easily use any Skija [bindings](https://github.com/JetBrains/skija/blob/master/docs/Getting%20Started.md) to draw into a Processing sketch.
## Requirements
* Java 11+ (Processing 4)
* A Processing sketch using either the `P2D` or `P3D` renderer.
## Download
Download a .jar of *processing-skia* from [releases](https://github.com/micycle1/processing-skia/releases/).
## Example
### Code
```
import micycle.processingSkia.SkiaCanvas;
import org.jetbrains.skija.*;
Canvas skiaCanvas;
@Override
public void settings() {
size(800, 800, P2D);
}
@Override
public void setup() {
skiaCanvas = SkiaCanvas.getSkiaCanvas(this);
}
@Override
public void draw() {
background(255);
Paint fill = new Paint().setShader(Shader.makeLinearGradient(400, 300, 400, 500, new int[] {0xFFFFA500, 0xFF4CA387}));
skiaCanvas.drawCircle(400, 400, 200, fill);
}
```
### Result

## More examples
A number of example Processing sketches are provided in [examples](https://github.com/micycle1/processing-skia/tree/main/examples).
Dash Stroke
Text on Path
## Further Work
Further work would wrap the Skija library itself, creating Processing-like bindings around Skija's API (a `PGraphicsSkia`) leading to the possibility of a dedicated Skia-based renderer in Processing.