Skip to content

imageDataInvertedColour

Matt Ellen edited this page Oct 28, 2015 · 4 revisions

Takes an ImageData and a boolean to determine if the alpha values should be inverted.
Returns a new ImageData object with the colour channels inverted from the original, and the alpha channel, too, if the boolean passed in was true.

var imageData = jsia.getImageDataFromImg(document.getElementById('jsiaImg'));
var invertedData = jsia.imageDataInvertedColour(imageData, false);
//ImageData { width=640,  height=480,  data=Uint8ClampedArray}

Clone this wiki locally