def METHOD_NAME(fn: str, common_at: CommonAt, pal: Dpla):
    print("Outputting water AT as image.")
    img_bin = common_at.decompress()
    tiles = list(iter_bytes(img_bin, int(8 * 8 / 2)))
    # create a dummy tile map containing all the tiles
    tilemap = []
    for i in range(0, len(tiles)):
        tilemap.append(TilemapEntry(i, False, False, 0, True))
    out_img = to_pil(
        tilemap,
        tiles,
        [pal.get_palette_for_frame(0, 0)],
        8,
        int(len(tiles) * 8 / 3),
        4 * 8,
        tiling_width=1,
        tiling_height=1,
    )
    os.makedirs(os.path.join(output_dir, "raw_img"), exist_ok=True)
    with open(os.path.join(output_dir, "raw_img", fn), "wb") as f:
        f.write(img_bin)
    out_img.save(os.path.join(output_dir, fn + ".png"))