public static void CompareWithReferenceDecoder <TPixel>( TestImageProvider <TPixel> provider, Image <TPixel> image, bool useExactComparer = true, float compareTolerance = 0.01f) where TPixel : struct, IPixel <TPixel> { string path = TestImageProvider <TPixel> .GetFilePathOrNull(provider); if (path == null) { throw new InvalidOperationException("CompareToOriginal() works only with file providers!"); } var testFile = TestFile.Create(path); Image <Rgba32> magickImage = DecodeWithMagick <Rgba32>(Configuration.Default, new FileInfo(testFile.FullPath)); if (useExactComparer) { ImageComparer.Exact.VerifySimilarity(magickImage, image); } else { ImageComparer.Tolerant(compareTolerance).VerifySimilarity(magickImage, image); } }