code: def test_save_grayscale_transparency(self, tmp_path):
      for mode, num_transparent in {
          "1": 1994,
          "L": 559,
          "I": 559,
      }.items():
          in_file = "Tests/images/" + mode.lower() + "_trns.png"
          with Image.open(in_file) as im:
              assert im.mode == mode
              assert im.info["transparency"] == 255
  
              im_rgba = im.convert("RGBA")
          assert (
              im_rgba.getchannel("A").getcolors()[0][0]
              == num_transparent
          )
  
          test_file = str(tmp_path / "temp.png")
          im.save(test_file)
  
          with Image.open(test_file) as test_im:
              assert test_im.mode == mode
              assert test_im.info["transparency"] == 255
              assert_image_equal(im, test_im)
  
          test_im_rgba = test_im.convert("RGBA")
          assert (
              test_im_rgba.getchannel("A").getcolors()[0][0]
              == num_transparent
          )
  
imports: from __future__ import annotations
  import re
  import sys
  import warnings
  import zlib
  from io import BytesIO
  import pytest
  from PIL import Image, ImageFile, PngImagePlugin, features
  from .helper import PillowLeakTestCase, assert_image, assert_image_equal, assert_image_equal_tofile, hopper, is_win32, mark_if_feature_version, skip_unless_feature
label_desc: Use image node_id 14 for calling the TestFilePng obj's underlying member method code with example usage: obj.test_save_grayscale_transparency(tmp_path) without return types