def METHOD_NAME(img, dump_index, func_name=None):
    test_tmpdir = op.join(get_nodegl_tempdir(), "tests")
    backend = os.environ.get("BACKEND")
    if backend:
        test_tmpdir = op.join(test_tmpdir, backend)
    os.makedirs(test_tmpdir, exist_ok=True)
    filename = op.join(test_tmpdir, f"{func_name}_{dump_index:03}.png")
    print(f"Dumping output image to {filename}")
    img.save(filename)
    dump_index += 1