title: html 5 canvas - get color of an image and then change the pixels with that color
body: <p>I don't know if this is possible, I've never really used html canvas, but I am aware of </p>
  
  <pre><code>var imgPixels = canvasContext.getImageData(0, 0, canvas.width, canvas.height);
  </code></pre>
  
  <p>but how do I use this to get for example all the pixels with a certain color and change these pixels to white?
  So let's say I have a pixel colored red:</p>
  
  <pre><code>if(pixel==red){
      pixel = white;
  }
  </code></pre>
  
  <p>that's the simple version of what I would like but not sure how to do that...</p>
  
  <p>anyone any ideas?</p>