code: def test_canvas_render(blend_func):
      """Test rendering a canvas to an array.
  
      Different blending functions are used to test what various Visuals may
      produce without actually using different types of Visuals.
  
      """
      with TestingCanvas(size=(125, 125), show=True, title="run") as c:
          view = c.central_widget.add_view()
  
          im1 = np.zeros((100, 100, 4)).astype(np.float32)
          im1[:, :, 0] = 1
          im1[:, :, 3] = 1
  
          im2 = np.zeros((50, 50, 4)).astype(np.float32)
          im2[:, :, 1] = 1
          im2[:, :, 3] = 0.4
  
          # Create the image
          image1 = scene.visuals.Image(im1, parent=view.scene)
          image1.transform = STTransform(translate=(20, 20, 0))
          image2 = scene.visuals.Image(im2, parent=view.scene)
          image2.transform = STTransform(translate=(0, 0, -1))
          if blend_func:
              image1.set_gl_state(
                  preset="translucent", blend_func=blend_func
              )
              image2.set_gl_state(
                  preset="translucent", blend_func=blend_func
              )
  
          rgba_result = c.render()
          rgb_result = c.render(alpha=False)
  
          # the results should be the same except for alpha
          np.testing.assert_allclose(rgba_result[..., :3], rgb_result)
          # the image should have something drawn in it
          assert not np.allclose(rgba_result[..., :3], 0)
          # the alpha should not be completely transparent
          assert not np.allclose(rgba_result[..., 3], 0)
          if blend_func is None or "one" in blend_func:
              # no transparency
              np.testing.assert_allclose(rgba_result[..., 3], 255)
          else:
              # the alpha should have some transparency
              assert (rgba_result[..., 3] != 255).any()
  
file_path: vispy/vispy/scene/tests/test_canvas.py
imports: from vispy import gloo, scene
  from vispy.testing import requires_application, TestingCanvas
  from vispy.visuals.transforms import STTransform
  import numpy
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_canvas_render(blend_func) without return types