Some big news: for approximately the past year, I've been working on an experimental web-based painting application. So far, it's been mostly for my own amusement, but a couple of months back I decided to work towards publishing the rasterization library I've been developing as a part of that effort as open source. The resulting glbrush.js library now lives at https://github.com/Oletus/glbrush.js and is licensed under the MIT license. There's also a simple example application included, so just clone the repo to your machine or head on out to http://oletus.fi/glbrush/example.html to give it a quick spin.

Supported features so far include:

  • Soft and hard-edged circular airbrush with opacity, flow and dynamic size control.
  • Unlimited undo, and operations can be undone out of sequence.
  • Alpha blended layers.
  • Replay animation.
  • Rasterization is done internally with at least 16 bits of precision, resulting in much better quality soft brush rendering than what is achievable with 2D canvas.
  • Serialization of pictures in text-based vector format and resizing them when parsing the serialization.
  • Largely unit tested using jasmine.
  • Style-checked with gjslint.

I'm planning to add more features, especially a wider selection of tools and more flexible layer compositing, but the biggest issue with the library right now is WebGL compatibility. I've worked around most quirks I've come across while testing on a selection of NVIDIA and AMD hardware, and the library includes an automatic fallback mechanism, but ideally I'd like it to run with the fastest WebGL backend using floating point textures on every device. Compatibility is bound to improve as WebGL implementations mature (an effort where I'm also personally involved), but wider testing is one thing I wish to eventually achieve by developing this out in the open. Anyway, expect to hear more about glbrush.js and also about the painting application I've been developing in the future!