title: Picking in non gl draw
body: <p>I've developed infrastructure for both canvas2d and webgl drawing methods.</p>
  
  <p>I've developed picking method for webgl and the goal is also to do so to canvas2d. have problem with the anti aliasing of canvas 2d.</p>
  
  <p>In webgl it was easy, simply in the shader changing the colors, removing some alpha values and the job was done.</p>
  
  <p>But in cavnas2d i don't have this power, and tried many technics to avoid that, but sadly didn't manage. The problem occurs in the edges of the text. There the values of the pixel are different than the picking color.. If it was only the alpha it was not a problem. but the rgb itself is different.</p>
  
  <p>So I Ignore the pixel when alpha is not 255 (No i have problem in small texts which most of the pixels are with alpha due to anti aliasing. </p>
  
  <p>Another problem is when one text is over another then the edges blends and there is not alpha (a=255).</p>
  
  <p><a href="https://i.stack.imgur.com/dRQy5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dRQy5.png" alt="Regular zoom"></a></p>
  
  <p><a href="https://i.stack.imgur.com/WdH4r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WdH4r.png" alt="red rectangle zoom"></a></p>
  
  <p>Didn't find anyway to disable the anti-aliasing.. and tried some <code>context.globalCompositeOperation</code> values with no luck.</p>
  
  <p>Anyone with suggestions ?</p>