You can use canvas.
var can = document.getElementById('canvas');
var ctx = can.getContext('2d');
upload the image and draw it on the canvas:
var img = new Image();
img.onload = function(){
can.width = img.width;
can.height = img.height;
ctx.drawImage(img, 0, 0, img.width, img.height);
}
img.src = 'toto.jpg';
and then you can use context methods to control the image:
https://developer.mozilla.org/en/canvas_tutorial
source
share