public static ReferenceImage CreateToleranceImage(string file, int tolerance, int maxDifference) { var image = new ReferenceImage(file, maxDifference); image.ColorComparer = new ToleranceColorComparer(tolerance); return(image); }
public static ReferenceImage CreateHueThresholdedImage(string file, ThresholdData thresholds, int maxDifference) { var image = new ReferenceImage(file, maxDifference); image.ColorComparer = new HueThresholdComparer(thresholds.Lower, thresholds.Upper); BitmapUtils.TransformPixels(image.Bitmap, col => col.ApplyHueThreshold(thresholds.Lower, thresholds.Upper)); return(image); }