Skip to main content


Canvas API for Deno, ported from canvaskit-wasm (Skia).


Import from or just import from raw GitHub URL,


mod.ts provides a default export exposing the complete CanvasKit API, and other exports from the file are types and util functions.

import Canvas from ''
import { serve } from "";

const canvas = Canvas.MakeCanvas(200, 200);
const ctx = canvas.getContext('2d');

ctx.fillStyle = 'red';
ctx.fillRect(10, 10, 200 - 20, 200 - 20);

const server = serve({ hostname: "", port: 8080 });
console.log(`HTTP webserver running. Access it at: http://localhost:8080/`);

for await (const request of server) {
  request.respond({ status: 200, body: canvas.toBuffer() });

And run with deno run --allow-net filename.ts. Or you can directly run from URL,

For using images, use loadImage method exported from mod.ts.

const image = await loadImage(myURL);
ctx.drawImage(image, x, y);