Slide 10
Slide 10 text
. . .
function getPixels(img) {
var cvs = createCanvas(img.width, img.height),
ctx = cvs.getContext('2d');
ctx.drawImage(img, 0, 0, img.width, img.height);
return {
ctx:
ctx,
data:
ctx.getImageData(0,0,cvs.width,cvs.height)
};
};
};