TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Skia Canvas: Browserless implementation of the HTML Canvas drawing API for node

288 点作者 DaniAkash6 个月前

20 条评论

silvajoao6 个月前
<a href="https:&#x2F;&#x2F;windowjs.org" rel="nofollow">https:&#x2F;&#x2F;windowjs.org</a> is a very similar concept -- it wraps Skia and exposes it as the Canvas API, but also embeds v8 for a very small runtime instead of using Node.<p>It was my first open-source project, released about 3 years ago.<p>I had plans to also expose WebGL, audio, etc and make it a viable platform for Javascript-based games on desktop.<p>Life and other projects happened instead, and development was discontinued. Happy to see this project also making Canvas accessible outside the browser!
评论 #42313639 未加载
评论 #42314941 未加载
h1fra6 个月前
Out of curiosity, what&#x27;s the use for such library? If you are on a desktop surely there is a better native library to draw shapes, no?
评论 #42310703 未加载
评论 #42309981 未加载
评论 #42314744 未加载
评论 #42312097 未加载
评论 #42311074 未加载
评论 #42310827 未加载
评论 #42315028 未加载
评论 #42311130 未加载
评论 #42318142 未加载
评论 #42310631 未加载
评论 #42310701 未加载
jahewson6 个月前
Skia ships with a WASM build that supports node, called CanvasKit [1], whereas this module is Rust bindings? I’d be keen to know what the pros and cons of each approach are.<p>1. <a href="https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;canvaskit-wasm" rel="nofollow">https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;canvaskit-wasm</a>
评论 #42309992 未加载
brabel6 个月前
Is this like a wrapper for the Rust crate?<p><a href="https:&#x2F;&#x2F;rust-skia.github.io&#x2F;doc&#x2F;skia_safe&#x2F;canvas&#x2F;struct.Canvas.html" rel="nofollow">https:&#x2F;&#x2F;rust-skia.github.io&#x2F;doc&#x2F;skia_safe&#x2F;canvas&#x2F;struct.Canv...</a>
评论 #42310252 未加载
评论 #42309427 未加载
评论 #42309100 未加载
Feathercrown6 个月前
I&#x27;ve been waiting for this for a long time. Previous attempts to do similar things required installing Node-Gyp, which was a nightmare.
modeless6 个月前
Huh, it&#x27;s more than just a rendering API: &quot;can render to windows using an OS-native graphics pipeline and provides a browser-like UI event framework&quot;. They could add wgpu to get WebGPU support and ANGLE to get WebGL support.
评论 #42310590 未加载
评论 #42309534 未加载
kevlened6 个月前
If you&#x27;re interested in node-compatible canvas implementations:<p>- canvaskit-wasm from the skia project - I don&#x27;t think it&#x27;s gpu-accelerated: <a href="https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;skia&#x2F;tree&#x2F;main&#x2F;modules&#x2F;canvaskit&#x2F;npm_build">https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;skia&#x2F;tree&#x2F;main&#x2F;modules&#x2F;canvaskit&#x2F;n...</a><p>- @napi-rs&#x2F;canvas - This is the fastest binding: <a href="https:&#x2F;&#x2F;github.com&#x2F;Brooooooklyn&#x2F;canvas?tab=readme-ov-file#performance">https:&#x2F;&#x2F;github.com&#x2F;Brooooooklyn&#x2F;canvas?tab=readme-ov-file#pe...</a><p>- node-canvas - Uses Cairo instead of Skia: <a href="https:&#x2F;&#x2F;github.com&#x2F;Automattic&#x2F;node-canvas">https:&#x2F;&#x2F;github.com&#x2F;Automattic&#x2F;node-canvas</a>
citeguised6 个月前
I&#x27;m using this currently with Deno for Advent of Code, if I need a simple window with graphics. (There&#x27;s a window-example[1])<p>It can be added by doing &quot;deno add npm:skia-canvas&quot;, adding &quot;nodeModulesDir: auto&quot; to the deno.json, and doing a &quot;deno install --allow-scripts&quot;.<p>[1] <a href="https:&#x2F;&#x2F;skia-canvas.org&#x2F;#rendering-to-a-window" rel="nofollow">https:&#x2F;&#x2F;skia-canvas.org&#x2F;#rendering-to-a-window</a>
TheRealPomax6 个月前
Super excited to see this, it&#x27;ll make writing web-compatible graphics that can also run standalone so much nicer (and without needing a compile things from source using a second scripting language to generate the code needed to compile the library for the first scripting language).<p>It&#x27;ll also be interesting to see how well this slots into things like VS Code for live-rendering canvas code (or code that has a translation layer for running on a web canvas)
pedroth6 个月前
I made something similar for node&#x2F;web, not so complete, but good. It can also create windows in the OS using SDL<p>Check the docs and examples<p><a href="https:&#x2F;&#x2F;github.com&#x2F;pedroth&#x2F;tela.js">https:&#x2F;&#x2F;github.com&#x2F;pedroth&#x2F;tela.js</a>
soegaard6 个月前
Are there plans for a C API?<p>The missing C API for Skia is most likely why Cairo is still alive.
评论 #42314365 未加载
评论 #42313918 未加载
lucasmerlin6 个月前
I use it in <a href="https:&#x2F;&#x2F;malmal.io" rel="nofollow">https:&#x2F;&#x2F;malmal.io</a> for rendering the drawn tiles on my server, it works really well.
MortyWaves6 个月前
Kind of strange to call it browserless as though Skia requires one to begin with. Been using the .NET Skia library in CLI and desktop applications for a while.
评论 #42309206 未加载
评论 #42309152 未加载
评论 #42309166 未加载
fredrikjacobson6 个月前
Would this work together with something like react-three-fiber to render 3D scenes on the server?
maelito6 个月前
I wonder if this would help to render MapLibre server-side. To provide map thumbnails.
jkrubin6 个月前
Anyone know what the difference between this and `@napi-rs&#x2F;canvas` is?<p>They seem similar?
dejongh6 个月前
Having skia power in nodejs is a cool idea. Thanks!
zazaulola6 个月前
How is it different from jimp?<p><a href="https:&#x2F;&#x2F;jimp-dev.github.io&#x2F;jimp&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jimp-dev.github.io&#x2F;jimp&#x2F;</a><p>Maybe there are some killer features?
评论 #42310848 未加载
评论 #42310448 未加载
promptdaddy6 个月前
Could this be consumed by Konva js for SSR ?
评论 #42309759 未加载
tantalor6 个月前
What does &quot;based on Skia&quot; actually mean?<p>Is it a fork of Skia?<p>Does it depend on Skia?<p>Did somebody look at a design diagram of Skia and redo the whole thing from scratch?<p>Did they read about Skia in a blogpost and get the gist of it?
评论 #42310636 未加载
评论 #42312522 未加载