diff --git a/tests/ImageSharp.Tests/ImageComparer.cs b/tests/ImageSharp.Tests/ImageComparer.cs
index 3e40cc2d7..9a30cc363 100644
--- a/tests/ImageSharp.Tests/ImageComparer.cs
+++ b/tests/ImageSharp.Tests/ImageComparer.cs
@@ -21,6 +21,38 @@ namespace ImageSharp.Tests
const int DefaultSegmentThreshold = 3; // The greyscale difference between 2 segements my be > 3 before it influences the overall difference
const float DefaultImageThreshold = 0.000F; // After segment thresholds the images must have no differences
+ ///
+ /// Fills the bounded area with a solid color and does a visual comparison between 2 images asserting the difference outwith
+ /// that area is less then a configurable threshold.
+ ///
+ /// The color of the expected image
+ /// The color type fo the the actual image
+ /// The expected image
+ /// The actual image
+ /// The bounds within the image has been altered
+ ///
+ /// The threshold for the percentage difference where the images are asumed to be the same.
+ /// The default/undefined value is
+ ///
+ ///
+ /// The threshold of the individual segments before it acumulates towards the overall difference.
+ /// The default undefined value is
+ ///
+ ///
+ /// This is a sampling factor we sample a grid of average pixels width by high
+ /// The default undefined value is
+ ///
+ public static void EnsureProcessorChangesAreConstrained(Image expected, Image actual, Rectangle bounds, float imageTheshold = DefaultImageThreshold, byte segmentThreshold = DefaultSegmentThreshold, int scalingFactor = DefaultScalingFactor)
+ where TPixelA : struct, IPixel
+ where TPixelB : struct, IPixel
+ {
+ // Draw identical shapes over the bounded and compare to ensure changes are constrained.
+ expected.Fill(NamedColors.HotPink, bounds);
+ actual.Fill(NamedColors.HotPink, bounds);
+
+ CheckSimilarity(expected, actual, imageTheshold, segmentThreshold, scalingFactor);
+ }
+
///
/// Does a visual comparison between 2 images and then asserts the difference is less then a configurable threshold
///
@@ -64,7 +96,7 @@ namespace ImageSharp.Tests
/// This is a sampling factor we sample a grid of average pixels width by high
/// The default undefined value is
///
- /// Returns a number from 0 - 1 which represents the diference focter between the images.
+ /// Returns a number from 0 - 1 which represents the difference focter between the images.
public static float PercentageDifference(this Image source, Image target, byte segmentThreshold = DefaultSegmentThreshold, int scalingFactor = DefaultScalingFactor)
where TPixelA : struct, IPixel
where TPixelB : struct, IPixel
diff --git a/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs b/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs
index 967844004..f9a5a9628 100644
--- a/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs
@@ -44,10 +44,7 @@ namespace ImageSharp.Tests.Processing.Binarization
image.BinaryThreshold(value, bounds)
.DebugSave(provider, value, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/Binarization/DitherTest.cs b/tests/ImageSharp.Tests/Processing/Binarization/DitherTest.cs
index 92f685dfa..f5227e7d0 100644
--- a/tests/ImageSharp.Tests/Processing/Binarization/DitherTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Binarization/DitherTest.cs
@@ -3,7 +3,7 @@
// Licensed under the Apache License, Version 2.0.
//
-namespace ImageSharp.Tests
+namespace ImageSharp.Tests.Processing.Binarization
{
using ImageSharp.Dithering;
using ImageSharp.Dithering.Ordered;
@@ -56,10 +56,7 @@ namespace ImageSharp.Tests
image.Dither(ditherer, bounds)
.DebugSave(provider, name, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
@@ -88,10 +85,7 @@ namespace ImageSharp.Tests
image.Dither(diffuser,.5F, bounds)
.DebugSave(provider, name, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/BlackWhiteTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/BlackWhiteTest.cs
index 066b392d7..73847ae3a 100644
--- a/tests/ImageSharp.Tests/Processing/ColorMatrix/BlackWhiteTest.cs
+++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/BlackWhiteTest.cs
@@ -36,10 +36,7 @@ namespace ImageSharp.Tests.Processing.ColorMatrix
image.BlackWhite(bounds)
.DebugSave(provider, null, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/ColorBlindnessTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/ColorBlindnessTest.cs
index 314b405c2..6d144fdae 100644
--- a/tests/ImageSharp.Tests/Processing/ColorMatrix/ColorBlindnessTest.cs
+++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/ColorBlindnessTest.cs
@@ -50,10 +50,7 @@ namespace ImageSharp.Tests.Processing.ColorMatrix
image.ColorBlindness(colorBlindness, bounds)
.DebugSave(provider, colorBlindness.ToString(), Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/GrayscaleTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/GrayscaleTest.cs
index f0a23429d..11d53a4c7 100644
--- a/tests/ImageSharp.Tests/Processing/ColorMatrix/GrayscaleTest.cs
+++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/GrayscaleTest.cs
@@ -54,10 +54,7 @@ namespace ImageSharp.Tests.Processing.ColorMatrix
image.Grayscale(value, bounds)
.DebugSave(provider, value.ToString());
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/HueTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/HueTest.cs
index a102adb92..e7dffe74a 100644
--- a/tests/ImageSharp.Tests/Processing/ColorMatrix/HueTest.cs
+++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/HueTest.cs
@@ -43,10 +43,7 @@ namespace ImageSharp.Tests.Processing.ColorMatrix
image.Hue(value, bounds)
.DebugSave(provider, value, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/KodachromeTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/KodachromeTest.cs
index 2824d8fd2..2da4e9fea 100644
--- a/tests/ImageSharp.Tests/Processing/ColorMatrix/KodachromeTest.cs
+++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/KodachromeTest.cs
@@ -36,10 +36,7 @@ namespace ImageSharp.Tests.Processing.ColorMatrix
image.Kodachrome(bounds)
.DebugSave(provider, null, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/LomographTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/LomographTest.cs
index 146af1652..629d9793a 100644
--- a/tests/ImageSharp.Tests/Processing/ColorMatrix/LomographTest.cs
+++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/LomographTest.cs
@@ -38,10 +38,7 @@ namespace ImageSharp.Tests
image.Lomograph(bounds)
.DebugSave(provider, null, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/PolaroidTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/PolaroidTest.cs
index 4304f3b45..b66589f4d 100644
--- a/tests/ImageSharp.Tests/Processing/ColorMatrix/PolaroidTest.cs
+++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/PolaroidTest.cs
@@ -36,10 +36,7 @@ namespace ImageSharp.Tests.Processing.ColorMatrix
image.Polaroid(bounds)
.DebugSave(provider, null, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/SaturationTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/SaturationTest.cs
index fcc9656f3..66c92262d 100644
--- a/tests/ImageSharp.Tests/Processing/ColorMatrix/SaturationTest.cs
+++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/SaturationTest.cs
@@ -43,10 +43,7 @@ namespace ImageSharp.Tests.Processing.ColorMatrix
image.Saturation(value, bounds)
.DebugSave(provider, value, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/SepiaTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/SepiaTest.cs
index 47eaa874e..5a54235fa 100644
--- a/tests/ImageSharp.Tests/Processing/ColorMatrix/SepiaTest.cs
+++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/SepiaTest.cs
@@ -36,10 +36,7 @@ namespace ImageSharp.Tests.Processing.ColorMatrix
image.Sepia(bounds)
.DebugSave(provider, null, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs
index e171dca99..cbcdd6b49 100644
--- a/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs
@@ -43,10 +43,7 @@ namespace ImageSharp.Tests.Processing.Convolution
image.BoxBlur(value, bounds)
.DebugSave(provider, value, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs
index b03afdb22..880c5beae 100644
--- a/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs
@@ -52,10 +52,7 @@ namespace ImageSharp.Tests.Processing.Convolution
image.DetectEdges(detector, bounds)
.DebugSave(provider, detector.ToString(), Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs
index d91e4089e..01b56dec8 100644
--- a/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs
@@ -43,10 +43,7 @@ namespace ImageSharp.Tests.Processing.Convolution
image.GaussianBlur(value, bounds)
.DebugSave(provider, value, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs
index 30bb44a67..f0ac37e1b 100644
--- a/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs
@@ -43,10 +43,7 @@ namespace ImageSharp.Tests.Processing.Convolution
image.GaussianSharpen(value, bounds)
.DebugSave(provider, value, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/Effects/AlphaTest.cs b/tests/ImageSharp.Tests/Processing/Effects/AlphaTest.cs
index a25e48ac3..737076270 100644
--- a/tests/ImageSharp.Tests/Processing/Effects/AlphaTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Effects/AlphaTest.cs
@@ -43,10 +43,7 @@ namespace ImageSharp.Tests.Processing.Effects
image.Alpha(value, bounds)
.DebugSave(provider, value, Extensions.Png);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs b/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs
index fd56dd6e7..97e6471f8 100644
--- a/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs
@@ -36,10 +36,7 @@ namespace ImageSharp.Tests.Processing.Effects
image.BackgroundColor(NamedColors.HotPink, bounds)
.DebugSave(provider, null, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/Effects/BrightnessTest.cs b/tests/ImageSharp.Tests/Processing/Effects/BrightnessTest.cs
index 38c374635..580b18187 100644
--- a/tests/ImageSharp.Tests/Processing/Effects/BrightnessTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Effects/BrightnessTest.cs
@@ -43,10 +43,7 @@ namespace ImageSharp.Tests.Processing.Effects
image.Brightness(value, bounds)
.DebugSave(provider, value, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); ;
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/Effects/ContrastTest.cs b/tests/ImageSharp.Tests/Processing/Effects/ContrastTest.cs
index 837cf8057..3003e9ddc 100644
--- a/tests/ImageSharp.Tests/Processing/Effects/ContrastTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Effects/ContrastTest.cs
@@ -43,10 +43,7 @@ namespace ImageSharp.Tests.Processing.Effects
image.Contrast(value, bounds)
.DebugSave(provider, value, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/Effects/InvertTest.cs b/tests/ImageSharp.Tests/Processing/Effects/InvertTest.cs
index af2ac1edb..8ad36e54c 100644
--- a/tests/ImageSharp.Tests/Processing/Effects/InvertTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Effects/InvertTest.cs
@@ -36,10 +36,7 @@ namespace ImageSharp.Tests.Processing.Effects
image.Invert(bounds)
.DebugSave(provider, null, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs b/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs
index 3d4725f88..de9bf583d 100644
--- a/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs
@@ -43,12 +43,7 @@ namespace ImageSharp.Tests
image.OilPaint(levels, brushSize, bounds)
.DebugSave(provider, string.Join("-", levels, brushSize), Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
-
- // TODO: Why does the png box fail without the additional parameter.
- ImageComparer.CheckSimilarity(source, image, 0.001F);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds, 0.001F);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs b/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs
index d52b7a290..d7cff18c3 100644
--- a/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs
@@ -76,6 +76,8 @@ namespace ImageSharp.Tests.Processing.Effects
Assert.Equal(sourceColor, image[tx, ty]);
}
}
+
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs b/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs
index 0a94659bb..0c4ad72ee 100644
--- a/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs
@@ -60,10 +60,7 @@ namespace ImageSharp.Tests.Processing.Overlays
image.Glow(bounds)
.DebugSave(provider, null, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
diff --git a/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs b/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs
index 7a566a1b3..583331bad 100644
--- a/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs
+++ b/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs
@@ -60,10 +60,7 @@ namespace ImageSharp.Tests.Processing.Overlays
image.Vignette(bounds)
.DebugSave(provider, null, Extensions.Bmp);
- // Draw identical shapes over the bounded and compare to ensure changes are constrained.
- image.Fill(NamedColors.HotPink, bounds);
- source.Fill(NamedColors.HotPink, bounds);
- ImageComparer.CheckSimilarity(image, source);
+ ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}