I am getting this error in Chrome and Opera Browsers:

```
Uncaught SecurityError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data.

```

The code is working fine in Internet Explorer, Mozilla Firefox, and Safari. But I need to fix it in Chrome and Opera. Please help me to find a solution to fix this problem?

I am getting this error at this line

```
imgData = ctx.getImageData(x1,y1,w,h);

```