code: def test_write_animation_L(tmp_path):
      """
      Convert an animated GIF to animated WebP, then compare the frame count, and first
      and last frames to ensure they're visually similar.
      """
  
      with Image.open("Tests/images/iss634.gif") as orig:
          assert orig.n_frames > 1
  
          temp_file = str(tmp_path / "temp.webp")
          orig.save(temp_file, save_all=True)
          with Image.open(temp_file) as im:
              assert im.n_frames == orig.n_frames
  
              # Compare first and last frames to the original animated GIF
              orig.load()
              im.load()
              assert_image_similar(im, orig.convert("RGBA"), 32.9)
              orig.seek(orig.n_frames - 1)
              im.seek(im.n_frames - 1)
              orig.load()
              im.load()
              assert_image_similar(im, orig.convert("RGBA"), 32.9)
  
file_path: pillow-simd/Tests/test_file_webp_animated.py
imports: import pytest
  from PIL import Image
  from .helper import assert_image_equal, assert_image_similar, is_big_endian, skip_unless_feature
label_desc: Use image node_id 2 for calling a global function with example usage: test_write_animation_L(tmp_path) without return types