$.getImageData({
url: "http://farm4.static.flickr.com/3002/2758349058_ab6dc9cfdc_z.jpg?zz=1",
success: function(image){
// Set up the canvas
var can = document.getElementsByTagName('canvas')[0];
var ctx = can.getContext('2d');
// Set the canvas width and heigh to the same as the image
$(can).attr('width', image.width);
$(can).attr('height', image.height);
// Draw the image on to the canvas
ctx.drawImage(image, 0, 0, image.width, image.height);
// Get the image data
var image_data = ctx.getImageData(0, 0, image.width, image.height);
var image_data_array = image_data.data;
// Write the image data to the canvas
ctx.putImageData(image_data, 0, 0);
},
error: function(xhr, text_status){
// Handle your error here
}
});