code: def test_image(is_3d):
      """Test image visual"""
      size = (100, 50)
      with TestingCanvas(size=size, bgcolor="w") as c:
          image = Image(cmap="grays", clim=[0, 1], parent=c.scene)
          shape = (size[1] - 10, size[0] - 10) + ((3,) if is_3d else ())
          np.random.seed(379823)
          data = np.random.rand(*shape)
          image.set_data(data)
          assert_image_approved(
              c.render(),
              "visuals/image%s.png" % ("_rgb" if is_3d else "_mono"),
          )
  
          # change to auto clims after first draw
          image.clim = "auto"
          assert_image_approved(
              c.render(),
              "visuals/image%s.png" % ("_rgb" if is_3d else "_mono"),
          )
  
file_path: vispy/vispy/visuals/tests/test_image.py
imports: from unittest import mock
  from vispy.scene import Image, PanZoomCamera
  from vispy.testing import requires_application, TestingCanvas, run_tests_if_main, IS_CI
  from vispy.testing.image_tester import assert_image_approved, downsample
  import numpy
  import pytest
  from vispy.testing.rendered_array_tester import compare_render, max_for_dtype
label_desc: Use image node_id 1 for calling a global function with example usage: test_image(is_3d) without return types