6 ms·
Ask HN: Canvas Drawing Library
I'm currently testing out Canvas JS libraries. I'd like to build a simple paint type of web app using Canvas and JS. I'd like to be able to create layers, draw, erase, etc. I tested out PaperJS, but it seems PaperJS is more geared towards SVG and fails at erasing. What popular Canvas JS libraries is everyone using nowadays?
- angersock 11y agoIf you're building something simple, why not just use the HTML5 Canvas API? There's no reason to overcomplicate things, and it'll give you fine control over how things work and what you expect it to do. Layers and whatnot are pretty simple to implement a rough cut of, so why make things complicated?
- maresca 11y agoGoing with the native Canvas API is where I'm heading. I've used RaphaelJS in the past. This week I've tested out PaperJS and FabricJS. I'm trying to save some time and code manageability with a framework.
- mindcrash 11y agoIf you loved RaphaelJS you'll probably like Snap.svg [1] aswell. It's originally authored by Dmitry Baranovskiy (Raphael's author) and sponsored by Adobe. [1] http://snapsvg.io/ http://snapsvg.io/
- Aaronneyer 11y agoCheck out LiterallyCanvas: http://literallycanvas.com/ http://literallycanvas.com/
- maresca 11y agoExcellent example, thanks! Looks like that has a dependency on React. I'm currently trying out Angular but I'll give this a shot too.
- lochlan 11y agoI am a big fan of pixi.js (http://www.pixijs.com http://www.pixijs.com). I haven't explored its "erasing" capabilities, but it is a great library for performant 2d graphics programming in the browser.
- doublerebel 11y agoI prefer PixiJS (http://www.pixijs.com http://www.pixijs.com), it comes with a ton of primitives and renders efficiently even on mobile. I've created layered drag-and-drop webapps with Pixi, draw & erase would not be much different.
- fgtx 11y agoIn simple cases like you described, you can always create your own. I've done something sorta like that in here: https://github.com/felipegtx/Raska https://github.com/felipegtx/Raska
- skuunk1 11y agoIf you have an ActionScript background, I highly recommend Easel JS. http://www.createjs.com/easeljs http://www.createjs.com/easeljs
- gandydancer 11y agoHow about http://fabricjs.com http://fabricjs.com
- jvanveen 11y agoi really liked to use fabric.js(http://fabricjs.com http://fabricjs.com) for a small collaborative drawing tool(https://github.com/wearespindle/dotd https://github.com/wearespindle/dotd). It runs both on node.js and in the browser, has pretty awesome serialization options and has all batteries included in general.
- irenkai 11y agoI've allways been a fan of kineticJS (now Konva). Seems the most extensible and can handle a lot of objects.