title: pixel coordinates on diamond
body: <p>I got an image with a couple of diamond put side by side like on the image below</p>
  
  <p><img src="https://i.stack.imgur.com/dHBnK.png" alt="diamond coordinates"></p>
  
  <p>The only coordinates I know on the image are the top corners (green text).<br>
  When I click on the image I get the coordinates of that point, but I'm not able to get which diamond I'm on.<br>
  For example I click on the red dot, how do I know that x:260, y:179 = the top diamond ?<br>
  And the blue belongs to the left ? etc... </p>
  
  <p>Thank you very much for your help.</p>
  
  <p>EDIT:<br>
  I finally used Canvas, but I think SVG would have worked as well for what I needed to do.</p>