code: def test_dispose2_diff(tmp_path):
      out = str(tmp_path / "temp.gif")
  
      # 4 frames: red/blue, red/red, blue/blue, red/blue
      circles = [
          ((255, 0, 0, 255), (0, 0, 255, 255)),
          ((255, 0, 0, 255), (255, 0, 0, 255)),
          ((0, 0, 255, 255), (0, 0, 255, 255)),
          ((255, 0, 0, 255), (0, 0, 255, 255)),
      ]
  
      im_list = []
      for i in range(len(circles)):
          # Transparent BG
          img = Image.new("RGBA", (100, 100), (255, 255, 255, 0))
  
          # Two circles per frame
          d = ImageDraw.Draw(img)
          d.ellipse([(0, 30), (40, 70)], fill=circles[i][0])
          d.ellipse([(60, 30), (100, 70)], fill=circles[i][1])
  
          im_list.append(img)
  
      im_list[0].save(
          out,
          save_all=True,
          append_images=im_list[1:],
          disposal=2,
          transparency=0,
      )
  
      with Image.open(out) as img:
          for i, colours in enumerate(circles):
              img.seek(i)
              rgb_img = img.convert("RGBA")
  
              # Check left circle is correct colour
              assert rgb_img.getpixel((20, 50)) == colours[0]
  
              # Check right circle is correct colour
              assert rgb_img.getpixel((80, 50)) == colours[1]
  
              # Check BG is correct colour
              assert rgb_img.getpixel((1, 1)) == (255, 255, 255, 0)
  
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 34 for calling a global function with example usage: test_dispose2_diff(tmp_path) without return types