def METHOD_NAME(subdir):
    from PIL import Image, ImageChops
    filename = "image.png"
    artifact_file = filename if subdir is None else posixpath.join(subdir, filename)
    image = Image.new("RGB", (100, 100))
    with mlflow.start_run():
        mlflow.log_image(image, artifact_file)
        artifact_path = None if subdir is None else posixpath.normpath(subdir)
        artifact_uri = mlflow.get_artifact_uri(artifact_path)
        run_artifact_dir = local_file_uri_to_path(artifact_uri)
        assert os.listdir(run_artifact_dir) == [filename]
        logged_path = os.path.join(run_artifact_dir, filename)
        loaded_image = Image.open(logged_path)
        # How to check Pillow image equality: https://stackoverflow.com/a/6204954/6943581
        assert ImageChops.difference(loaded_image, image).getbbox() is None