code: def test_read_write_image():
      """Test reading and writing of images"""
      fname = op.join(temp_dir, "out.png")
      im1 = load_crate()
      imsave(fname, im1, format="png")
      with warnings.catch_warnings(record=True):  # PIL unclosed file
          im2 = imread(fname)
      assert_allclose(im1, im2)
  
file_path: vispy/vispy/io/tests/test_image.py
imports: import numpy
  from numpy.testing import assert_array_equal, assert_allclose
  from os import path
  import warnings
  from vispy.io import load_crate, imsave, imread, read_png, write_png
  from vispy.testing import requires_img_lib, run_tests_if_main
  from vispy.util import _TempDir
label_desc: Use image node_id 2 for calling a global function with example usage: test_read_write_image() without return types