putimagedata external javascript code example Example: getImageData() ctx.getImageData(sx, sy, sw, sh);