code: def test_ffmpeg_write_image(
      util, size, logfile, pixel_format, expected_result
  ):
      filename = os.path.join(
          util.TMP_DIR, "moviepy_ffmpeg_write_image.png"
      )
      if os.path.isfile(filename):
          try:
              os.remove(filename)
          except PermissionError:
              pass
  
      image_array = color_gradient(
          size,
          (0, 0),
          p2=(5, 0),
          color_1=(255, 0, 0),
          color_2=(0, 255, 0),
      )
  
      if hasattr(expected_result[0], "__traceback__"):
          with pytest.raises(expected_result[0]) as exc:
              ffmpeg_write_image(
                  filename,
                  image_array,
                  logfile=logfile,
                  pixel_format=pixel_format,
              )
          assert expected_result[1] in str(exc.value)
          return
      else:
          ffmpeg_write_image(
              filename,
              image_array,
              logfile=logfile,
              pixel_format=pixel_format,
          )
  
      assert os.path.isfile(filename)
  
      if logfile:
          assert os.path.isfile(filename + ".log")
          os.remove(filename + ".log")
  
      im = Image.open(filename, mode="r")
      for i in range(im.width):
          for j in range(im.height):
              assert im.getpixel((i, j)) == expected_result[j][i]
  
file_path: moviepy/tests/test_ffmpeg_writer.py
imports: import multiprocessing
  import os
  from PIL import Image
  import pytest
  from moviepy.video.compositing.concatenate import concatenate_videoclips
  from moviepy.video.io.ffmpeg_writer import ffmpeg_write_image, ffmpeg_write_video
  from moviepy.video.io.gif_writers import write_gif
  from moviepy.video.io.VideoFileClip import VideoFileClip
  from moviepy.video.tools.drawing import color_gradient
  from moviepy.video.VideoClip import BitmapClip, ColorClip
label_desc: Use image node_id 2 for calling a global function with example usage: test_ffmpeg_write_image(util, size, logfile, pixel_format, expected_result) without return types