Adam Stacoviak

node-o3-canvas: HTML5 Canvas API for NodeJS

This isn’t the first time we’ve featured the work of our friends over at In the past we mentioned o3 and Cloud9 and even had them on the podcast, see episode #16.

Their project, node-o3-canvas, is an HTML5 Canvas implementation for NodeJS based on LibAGG and Freetype. It’s implemented using their previously mentioned O3 component system. The goal with node-o3-canvas is not only to create a Canvas-spec type API, but also to extend it to provide easy image resizing, and image processing API’s for server side image processing needs. makes use of node-o3-canvas as a way to render Canvas charts server-side to allow emailing or save-as-picture.

Example usage

How to use:

var createContext = require('path/to/node-o3-canvas/lib/o3-canvas');

Here’s a simple example usage:

var ctx = createContext(300,300, "argb");
ctx.fillStyle = "rgb(200,0,0)";
ctx.fillRect (10, 10, 55, 50);

var buf = ctx.pngBuffer();

[Source on GitHub] [Readme] [Blog Post]


Sign in or Join to comment or subscribe

Player art
  0:00 / 0:00