title: Fast way of calculating differences between two bitmaps
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2031217/what-is-the-fastest-way-i-can-compare-two-equal-size-bitmaps-to-determine-whethe">What is the fastest way I can compare two equal-size bitmaps to determine whether they are identical?</a>  </p>
  </blockquote>
  
  
  
  <p>I'm trying to efficiently calculate the differences between two bitmaps and set any matching pixels black. I've tried this:</p>
  
  <pre><code>for (int x = 0; x &lt; 1280; x++)
  {
      for (int y = 0; y &lt; 720; y++)
      {
          if (bitmap.GetPixel(x, y) == bitmap2.GetPixel(x, y))
          {
              bitmap2.SetPixel(x, y, Color.Black);
          }
      }
  }
  </code></pre>
  
  <p>But it turns out that GetPixel and SetPixel are slow so this doesn't really work well enough. Anyone know an alternative (faster) way of doing this?</p>