Пример #1
0
        public static ReferenceImage CreateToleranceImage(string file, int tolerance, int maxDifference)
        {
            var image = new ReferenceImage(file, maxDifference);

            image.ColorComparer = new ToleranceColorComparer(tolerance);

            return(image);
        }
Пример #2
0
        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);
        }