Node Canvas - It is the word that Awesome uses to describe what it thinks is awesome.
Html V and CSS: the Reckoning is here, and there are a lot of stuff flying around that is mostly ready and Pretty consistent. One of these tools is Canvas, the Flash killer for people who never use Flash. Unfortunately you can't completely count on 100% coverage with Canvas, esp. for people with older (one year older?????) browsers.
Once again, Node comes to the rescue with Node-Canvas. (https://github.com/LearnBoost/node-canvas) Node Canvas allows you to create bitmaps, save them as images, and/or stream them to the clients' browsers. Its great for things like creating custom avatars for users, combining images with polygon graphics, graphic filters (blur, posterize, etc.) on bitmaps. or whatever graphic goodness you can conceive of. I'm currently working on a game based on Mars and using the MOLA data to render terrains. The MOLA data is available in very high res files, and I want to be able to take sections of those files and break them out into smaller game tiles. Node Canvas' ability to sample regions of a bitmap and save them out into other canvas / images is ideal here. Also ideal is the fact that the MOLA data comes in a long binary stream of integers in row/column format and Node Canvas stores bitmap data in a similar fomat, so I can suck binary data from MOLA data and spit it out in Canvas Bitmap data with a minimum of manipulation. (more on this later.) Node Canvas can be compared to GD library - but it is a lot richer and more flexible.
Node Canvas is backed by Cairo (http://cairographics.org/) - a server side graphics library. Its easy to install (if not instant); for the OSX crowd, it is MacPorts friendly. Once Cairo is in place, a simple npm install canvas gets you all you need to get Node Canvas up and running. Thanks to LearnBoost (the Mongoose people) for their work on Node Canvas, and of course, TJ Holowaychuk.

This image was generated directly from Mars topographical data courtesy of MOLA, and node canvas.
| Attachment | Size |
|---|---|
| mars.png | 636.16 KB |

Post new comment