Are there JavaScript libraries for image processing, for example:
http://www.pixastic.com/ tends to work well. In addition, if you want high performance, you can use the shader in WebGL.
There is a processing port for JavaScript: Processing.js