public async Task CanGenerateDiffRowSpan() { string image1Path = "TestFiles/en1.png"; string image2Path = "TestFiles/ja1.png"; string diffImagePath12 = "TestFiles/diff12.png"; string diffImagePath21 = "TestFiles/diff21.png"; double diff11 = ImageCompareSharp.GenerateDiffImage(image1Path, image1Path); double diff12 = ImageCompareSharp.GenerateDiffImage(image1Path, image2Path, diffImagePath12); double diff21 = ImageCompareSharp.GenerateDiffImage(image2Path, image1Path, diffImagePath21); Assert.AreEqual(diff12, diff21, 0.01); }
/// <summary> /// Compares two images, generates diff image, returns % of differences in a range [0.0-1.0] /// </summary> /// <param name="firstImagePath">Path to first image</param> /// <param name="secondImagePath">Path to second image</param> /// <param name="diffImagePath">Path to diff image</param> /// <returns>% of differences in a range [0.0-1.0]</returns> public static double CompareImages(string firstImagePath, string secondImagePath, string diffImagePath) { return(ImageCompareSharp.GenerateDiffImage(firstImagePath, secondImagePath, diffImagePath)); }