title: context.getImageData() on localhost?
body: <p>I have the following snippet of code and I'm trying to run it from localhost (OSX, running XAMPP):</p>
  
  <pre><code>var canvas = document.getElementById('mycanvas');
      var cx = canvas.getContext('2d');
  
      var myImg = new Image();
      myImg.src = 'images/lion.jpg';
  
      $(myImg).load(function() {
          cx.drawImage(myImg, 0, 0);
          var imgData = cx.getImageData(0,0,150,150);
      });
  </code></pre>
  
  <p>But when I run it I get this error from the console:</p>
  
  <pre><code>Unable to get image data from canvas because the canvas has been tainted by cross-origin data.
  site.js:11Uncaught Error: SECURITY_ERR: DOM Exception 18
  </code></pre>
  
  <p>I found some similar questions here and I know that this has something to do with the fact that I'm working locally and this wouldn't happen if I was trying to access the image from the same domain. I don't know if this makes sense, but it's what I understood.</p>
  
  <p>My question is, how can I make this work in a local dev environment?</p>