This repository has been archived by the owner on Apr 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
skiacanvas.js
23 lines (19 loc) · 13.3 KB
/
skiacanvas.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const { Canvas, loadImage } = require('skia-canvas');
const fs = require('fs');
let canvas = new Canvas(48, 27);
let ctx = canvas.getContext("2d");
const serializedSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080" width="48" height="27" preserveAspectRatio="xMidYMid meet" style="width: 100%; height: 100%; transform: translate3d(0px, 0px, 0px); content-visibility: visible;"><defs><clipPath id="__lottie_element_2"><rect width="1920" height="1080" x="0" y="0"/></clipPath><filter id="__lottie_element_6" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"><feComponentTransfer in="SourceGraphic"><feFuncA type="table" tableValues="1.0 0.0"/></feComponentTransfer></filter><mask id="__lottie_element_5" mask-type="alpha"><g filter="url(#__lottie_element_6)"><rect width="1920" height="1080" x="0" y="0" fill="#ffffff" opacity="0"/><g transform="matrix(0.015529580414295197,0.9998794198036194,-0.9998794198036194,0.015529580414295197,1484.68212890625,414.59979248046875)" opacity="1" style="display: block;"><g opacity="1" transform="matrix(1,0,0,1,0,0)"><path fill="rgb(255,255,0)" fill-opacity="1" d=" M271.4110107421875,4.491000175476074 C271.4110107421875,4.491000175476074 -12.949999809265137,271.1390075683594 -12.949999809265137,271.1390075683594 C-89.06300354003906,342.510986328125 -208.6230010986328,338.6669921875 -279.9949951171875,262.5539855957031 C-279.9949951171875,262.5539855957031 -279.9960021972656,262.5539855957031 -279.9960021972656,262.5539855957031 C-351.3680114746094,186.4409942626953 -347.52398681640625,66.88099670410156 -271.4110107421875,-4.491000175476074 C-271.4110107421875,-4.491000175476074 12.949999809265137,-271.1390075683594 12.949999809265137,-271.1390075683594 C89.06300354003906,-342.510986328125 208.6230010986328,-338.6669921875 279.9949951171875,-262.5539855957031 C279.9949951171875,-262.5539855957031 279.9960021972656,-262.5539855957031 279.9960021972656,-262.5539855957031 C351.3680114746094,-186.4409942626953 347.52398681640625,-66.88099670410156 271.4110107421875,4.491000175476074z"/></g></g></g></mask><filter id="__lottie_element_13" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"><feComponentTransfer in="SourceGraphic"><feFuncA type="table" tableValues="1.0 0.0"/></feComponentTransfer></filter><mask id="__lottie_element_12" mask-type="alpha"><g filter="url(#__lottie_element_13)"><rect width="1920" height="1080" x="0" y="0" fill="#ffffff" opacity="0"/><g transform="matrix(0.015529580414295197,0.9998794198036194,-0.9998794198036194,0.015529580414295197,1484.68212890625,414.59979248046875)" opacity="1" style="display: block;"><g opacity="1" transform="matrix(1,0,0,1,0,0)"><path fill="rgb(255,255,0)" fill-opacity="1" d=" M271.4110107421875,4.491000175476074 C271.4110107421875,4.491000175476074 -12.949999809265137,271.1390075683594 -12.949999809265137,271.1390075683594 C-89.06300354003906,342.510986328125 -208.6230010986328,338.6669921875 -279.9949951171875,262.5539855957031 C-279.9949951171875,262.5539855957031 -279.9960021972656,262.5539855957031 -279.9960021972656,262.5539855957031 C-351.3680114746094,186.4409942626953 -347.52398681640625,66.88099670410156 -271.4110107421875,-4.491000175476074 C-271.4110107421875,-4.491000175476074 12.949999809265137,-271.1390075683594 12.949999809265137,-271.1390075683594 C89.06300354003906,-342.510986328125 208.6230010986328,-338.6669921875 279.9949951171875,-262.5539855957031 C279.9949951171875,-262.5539855957031 279.9960021972656,-262.5539855957031 279.9960021972656,-262.5539855957031 C351.3680114746094,-186.4409942626953 347.52398681640625,-66.88099670410156 271.4110107421875,4.491000175476074z"/></g></g></g></mask></defs><g clip-path="url(#__lottie_element_2)"><g mask="url(#__lottie_element_12)" style="display: block;"><g transform="matrix(1,0,0,1,960,532)" opacity="1"><g opacity="1" transform="matrix(1,0,0,1,0,0)"><path fill="rgb(41,72,226)" fill-opacity="1" d=" M960,548 C960,548 -960,548 -960,548 C-960,548 -960,-548 -960,-548 C-960,-548 960,-548 960,-548 C960,-548 960,548 960,548z"/></g></g></g><g mask="url(#__lottie_element_5)" style="display: block;"><g transform="matrix(0.9995700120925903,0.029322374612092972,-0.029322374612092972,0.9995700120925903,1473.4227294921875,684.684326171875)" opacity="1"><g opacity="1" transform="matrix(1,0,0,1,0,0)"><path fill="rgb(174,73,119)" fill-opacity="1" d=" M271.4110107421875,4.491000175476074 C271.4110107421875,4.491000175476074 -12.949999809265137,271.1390075683594 -12.949999809265137,271.1390075683594 C-89.06300354003906,342.510986328125 -208.6230010986328,338.6669921875 -279.9949951171875,262.5539855957031 C-279.9949951171875,262.5539855957031 -279.9960021972656,262.5539855957031 -279.9960021972656,262.5539855957031 C-351.3680114746094,186.4409942626953 -347.52398681640625,66.88099670410156 -271.4110107421875,-4.491000175476074 C-271.4110107421875,-4.491000175476074 12.949999809265137,-271.1390075683594 12.949999809265137,-271.1390075683594 C89.06300354003906,-342.510986328125 208.6230010986328,-338.6669921875 279.9949951171875,-262.5539855957031 C279.9949951171875,-262.5539855957031 279.9960021972656,-262.5539855957031 279.9960021972656,-262.5539855957031 C351.3680114746094,-186.4409942626953 347.52398681640625,-66.88099670410156 271.4110107421875,4.491000175476074z"/></g></g></g></g></svg>';
const svg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOTIwIDEwODAiIHdpZHRoPSI0OCIgaGVpZ2h0PSIyNyIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgc3R5bGU9IndpZHRoOiAxMDAlOyBoZWlnaHQ6IDEwMCU7IHRyYW5zZm9ybTogdHJhbnNsYXRlM2QoMHB4LCAwcHgsIDBweCk7IGNvbnRlbnQtdmlzaWJpbGl0eTogdmlzaWJsZTsiPjxkZWZzPjxjbGlwUGF0aCBpZD0iX19sb3R0aWVfZWxlbWVudF8yIj48cmVjdCB3aWR0aD0iMTkyMCIg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w0Z6IARIowDN7McL2HTr8w6oRBINFDAEDKMYLexBCnOy1uYdoKXZS9cxD290g6UwG628HoOYaQiVArCjF1twD8U0Mimgirm4ym6MYLpheKkXWQk+YxXFsBBJmPAVgzCjk+0Ii/3Lj+OkdEBoawWLpjzgBwVa98JvL2XeAAAAAElFTkSuQmCC';
// render to files using a background thread
async function render() {
const image = await loadImage(svg);
// save the graphic...
await canvas.saveAs("o-skiacanvas.png");
}
render();
// // ...or save the file synchronously from the main thread
// loadImage(png).then((image) => {
// ctx.drawImage(image, 0, 0);
// canvas.saveAsSync("o-skia2.png")
// });