code: def test_transparent_optimize(tmp_path):
      # From issue #2195, if the transparent color is incorrectly optimized out, GIF loses
      # transparency.
      # Need a palette that isn't using the 0 color, and one that's > 128 items where the
      # transparent color is actually the top palette entry to trigger the bug.
  
      data = bytes(range(1, 254))
      palette = ImagePalette.ImagePalette("RGB", list(range(256)) * 3)
  
      im = Image.new("L", (253, 1))
      im.frombytes(data)
      im.putpalette(palette)
  
      out = str(tmp_path / "temp.gif")
      im.save(out, transparency=253)
      with Image.open(out) as reloaded:
          assert reloaded.info["transparency"] == 253
  
imports: from io import BytesIO
  import pytest
  from PIL import GifImagePlugin, Image, ImageDraw, ImagePalette, features
  from .helper import assert_image_equal, assert_image_equal_tofile, assert_image_similar, hopper, is_pypy, netpbm_available
label_desc: Use image node_id 49 for calling a global function with example usage: test_transparent_optimize(tmp_path) without return types