code: def test_apng_mode():
      with Image.open("Tests/images/apng/mode_16bit.png") as im:
          assert im.mode == "RGBA"
          im.seek(im.n_frames - 1)
          assert im.getpixel((0, 0)) == (0, 0, 128, 191)
          assert im.getpixel((64, 32)) == (0, 0, 128, 191)
  
      with Image.open("Tests/images/apng/mode_greyscale.png") as im:
          assert im.mode == "L"
          im.seek(im.n_frames - 1)
          assert im.getpixel((0, 0)) == 128
          assert im.getpixel((64, 32)) == 255
  
      with Image.open(
          "Tests/images/apng/mode_greyscale_alpha.png"
      ) as im:
          assert im.mode == "LA"
          im.seek(im.n_frames - 1)
          assert im.getpixel((0, 0)) == (128, 191)
          assert im.getpixel((64, 32)) == (128, 191)
  
      with Image.open("Tests/images/apng/mode_palette.png") as im:
          assert im.mode == "P"
          im.seek(im.n_frames - 1)
          im = im.convert("RGB")
          assert im.getpixel((0, 0)) == (0, 255, 0)
          assert im.getpixel((64, 32)) == (0, 255, 0)
  
      with Image.open("Tests/images/apng/mode_palette_alpha.png") as im:
          assert im.mode == "P"
          im.seek(im.n_frames - 1)
          im = im.convert("RGBA")
          assert im.getpixel((0, 0)) == (255, 0, 0, 0)
          assert im.getpixel((64, 32)) == (255, 0, 0, 0)
  
      with Image.open(
          "Tests/images/apng/mode_palette_1bit_alpha.png"
      ) as im:
          assert im.mode == "P"
          im.seek(im.n_frames - 1)
          im = im.convert("RGBA")
          assert im.getpixel((0, 0)) == (0, 0, 255, 128)
          assert im.getpixel((64, 32)) == (0, 0, 255, 128)
  
imports: import pytest
  from PIL import Image, ImageSequence, PngImagePlugin
label_desc: Use image node_id 11 for calling a global function with example usage: test_apng_mode() without return types