def METHOD_NAME(image_diff, image_diff_dir, screenshot_path, diff_path, extra):
    def inner(test_name, image_name):
        # insure no alpha channel present in the screenshot being compared
        png = Image.open(
            os.path.join(screenshot_path, "{}.png".format(image_name))
        ).convert("RGB")
        png.save(os.path.join(screenshot_path, "{}.png".format(image_name)))
        expected_name = str(
            Path(__file__).parent.parent
            / "testdata"
            / "control_images"
            / test_name
            / "expected_{}-{}.png".format(image_name, platform.system())
        )
        if not os.path.isfile(expected_name):
            expected_name = str(
                Path(__file__).parent.parent
                / "testdata"
                / "control_images"
                / test_name
                / "expected_{}.png".format(image_name)
            )
        result = image_diff(
            os.path.join(screenshot_path, "{}.png".format(image_name)),
            expected_name,
            threshold=0.025,
            suffix=image_name,
            throw_exception=False,
        )
        if os.path.exists(result.diff_path):
            shutil.copyfile(
                result.diff_path,
                os.path.join(diff_path, "{}_diff.png".format(image_name)),
            )
            extra.append(
                extras.html(
                    "Screenshot check for {}: diff value {}, threshold {}".format(
                        image_name, result.value, result.thresh
                    )
                )
            )
            extra.append(
                extras.html('<img src="diffs/{}_diff.png"/>'.format(image_name))
            )
        return result.value < result.thresh
    return inner