1

I'm trying to get color data from an image on the web using color-thief.js.

myImage = $('#myImage');
dominantColor = getDominantColor(myImage);
paletteArray = createPalette(myImage, 10); 

Chrome is complaining about safety issues:

Unable to get image data from canvas because 
the canvas has been tainted by cross-origin data.

Here is jsFiddle. (Why does it have two apples when I only have one <img> tag??)

This question has been addressed before, but I couldn't understand it.
e.g. Drawing an image from a data URL to a canvas which seems specific to HTML5 Canvas.

Community
  • 1
  • 1
john mangual
  • 7,718
  • 13
  • 56
  • 95

0 Answers0