code: def test_2bit_palette(tmp_path):
      # issue #2258, 2 bit palettes are corrupted.
      outfile = str(tmp_path / "temp.png")
  
      rgb = b"\x00" * 2 + b"\x01" * 2 + b"\x02" * 2
      img = Image.frombytes("P", (6, 1), rgb)
      img.putpalette(b"\xFF\x00\x00\x00\xFF\x00\x00\x00\xFF")  # RGB
      img.save(outfile, format="PNG")
  
      assert_image_equal_tofile(img, outfile)
  
file_path: pillow-simd/Tests/test_imagepalette.py
imports: import pytest
  from PIL import Image, ImagePalette
  from .helper import assert_image_equal, assert_image_equal_tofile
label_desc: Use image node_id 12 for calling a global function with example usage: test_2bit_palette(tmp_path) without return types