fn compare_to_truth_with_tolerance<P, F>(
    input_file_name: &str,
    truth_file_name: &str,
    op: F,
    tol: u8,
) where
    P: Pixel<Subpixel = u8> + PixelWithColorType,
    Image<P>: FromDynamic,
    F: Fn(&Image<P>) -> Image<P>,
{
    let input = Image::<P>::from_dynamic(&load_image_or_panic(
        Path::new(INPUT_DIR).join(input_file_name),
    ));
    let actual = op(&input);
    compare_to_truth_image_with_tolerance(&actual, truth_file_name, tol);
}
Loads an input image, applies a function to it and checks that the result
matches a 'truth' image to within a given per-pixel tolerance.
tests/regression.rs