title: How to find the difference between two images?
body: <p>I'm developing a screen-sharing application. In this project I need to transport images over the internet. Obviously, I can't send a new picture over the internet every few seconds, it would be extremely slow.
  I want to send one image of the server's screen to the client, and afterwards, instead of sending a new picture sending only the pixels that have been changed since the last image (the one the client already has).</p>
  
  <p>I have written this code:</p>
  
  <pre><code>private List&lt;Color&gt; CompareBitmaps(Image old, Image _new)
  {
      List&lt;Color&gt; returnList = new List&lt;Color&gt;();
  
      for(int i = 0; i &lt; old.Width; i++)
          for (int j = 0; j &lt; old.Height; j++)
          {
              if (((Bitmap)old).GetPixel(i, j) != ((Bitmap)_new).GetPixel(i, j))
              {
                  returnList.Add(((Bitmap)_new).GetPixel(i, j));
              }
          }
  
  return returnList;
  }
  </code></pre>
  
  <p>However, it works way too slow.</p>
  
  <p>I'm looking for a faster algorithm, one with a better complexity.</p>
  
  <p>Note: I don't want a built library that does that. I need an algorithm.</p>