I am trying to compare images in folder(s) and storing diffrence on a 3rd folder.
While I am trying to compare between Image-1 and Image-2, the difference should be Image-3.
Difference between first two images (Image-3) is not showing full, only partial is showing, and I am getting GDI+ error
Code is
// Create the difference image.
bool are_identical = true;
Color eq_color = Color.White;
Color ne_color = Color.Red;
for (int x = 0; x < wid; x++)
{
for (int y = 0; y < hgt; y++)
{
if (bm1.GetPixel(x, y).Equals(bm2.GetPixel(x, y)))
{
bm3.SetPixel(x, y, eq_color);
}
else
{
bm3.SetPixel(x, y, ne_color);
are_identical = false;
bm3.Save(@"C:\XPS Files\DiffrenceofImages\" + new1[i]);
}
}
}
GDI+ error occurs at
bm3.save(@"C:\XPS Files\DiffrenceofImages\" + new1[i]);
So the difference of image shows partial (until loop completed) e.g. if difference of 2 image is a circle, I get 80% of that circle.