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

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.

Ajax.org 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.clearRect(0,0,300,300);
ctx.fillStyle = "rgb(200,0,0)";
ctx.fillRect (10, 10, 55, 50);

var buf = ctx.pngBuffer();
console.log(buf.toBase64());

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


Have comments? Send a tweet to @TheChangelog on Twitter.

Subscribe to The Changelog Weekly – our weekly email covering everything that hits our open source radar.