.onDropImage(function(image) { /* desaturate image */ this.drawImage(image, 0, 0).setHsl(null, 0, null); });
.matchPalette(["#0f380f", "#306230", "#8bac0f", "#9bbc0f"]);
.getPalette()
.resizePixel(2)
.trim("#eeeeff");
.crop(x, y, width, height);
Applies alpha value to pixels according to their grayscale value (r + g + b) / 3. White is fully opaque. Black is transparent.
.grayscaleToAlpha();
Depending on platform mouse or touch event will be bound
cq().framework({ onRender: function() { this.clear("rgba(10, 10, 10, 0.1)"); }, onMouseDown: function(x, y) { this.beginPath().fillStyle("#00ffff").circle(x, y, 32).fill(); }, onMouseUp: function(x, y) { this.beginPath().fillStyle("#ff0088").circle(x, y, 32).fill(); }, onMouseMove: function(x, y) { this.beginPath().fillStyle("#ffaa00").circle(x, y, 32).fill(); } });
Canvas Query is a wrapper library for HTML5 Canvas element which allows it to be used with jQuery like syntax. Also it adds a lot of common use image manipulation methods mainly convenient for gamedevelopers.
Cheers
Rezoner