Possible Duplicate:
What is the fastest way I can compare two equal-size bitmaps to determine whether they are identical?
I'm trying to efficiently calculate the differences between two bitmaps and set any matching pixels black. I've tried this:
for (int x = 0; x < 1280; x++)
{
for (int y = 0; y < 720; y++)
{
if (bitmap.GetPixel(x, y) == bitmap2.GetPixel(x, y))
{
bitmap2.SetPixel(x, y, Color.Black);
}
}
}
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?