title: Check if image background is white using Javascript
body: <p>im creating a way for users to add some buttons to their image. Now i thought it would be cool if the button could change color depending of the background color of the image.</p>
  
  <p>To start with i wanted to go for the black / white contrast.</p>
  
  <p>So if the background is white then the button will be black and if the background color is black then the button should be white.</p>
  
  <p>My question is however is it possible to identify the background of an image using only javascript? and if so how?</p>