code: def test_dispose2_palette(tmp_path):
      out = str(tmp_path / "temp.gif")
  
      # Four colors: white, grey, black, red
      circles = [
          (255, 255, 255),
          (153, 153, 153),
          (0, 0, 0),
          (255, 0, 0),
      ]
  
      im_list = []
      for circle in circles:
          # Red background
          img = Image.new("RGB", (100, 100), (255, 0, 0))
  
          # Circle in center of each frame
          d = ImageDraw.Draw(img)
          d.ellipse([(40, 40), (60, 60)], fill=circle)
  
          im_list.append(img)
  
      im_list[0].save(
          out, save_all=True, append_images=im_list[1:], disposal=2
      )
  
      with Image.open(out) as img:
          for i, circle in enumerate(circles):
              img.seek(i)
              rgb_img = img.convert("RGB")
  
              # Check top left pixel matches background
              assert rgb_img.getpixel((0, 0)) == (255, 0, 0)
  
              # Center remains red every frame
              assert rgb_img.getpixel((50, 50)) == circle
  
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 33 for calling a global function with example usage: test_dispose2_palette(tmp_path) without return types