Link: HTML5 multiply filter with canvas | Alberto Gasparin

Here’s a great little script I found useful today as I was working on having dynamic effects applied to javascript via canvas.

“The canvas element provides scripts with a resolution-dependent bitmap canvas, which can be used for rendering graphs, game graphics, or other visual images on the fly.”

Thanks to the canvas APIs I was able to get the color values of each pixel of the image and transform them applying the multiply formula, which simply is:

MultiplyColor = [255, 105, 0];
function multiply(topValue, bottomValue){
return topValue * bottomValue / 255;
}

via HTML5 multiply filter with canvas via Alberto Gasparin.