code: def __init__(self):
      app.Canvas.__init__(self, keys="interactive", size=((512), (512)))
  
      self.program = gloo.Program(
          VERT_SHADER, FRAG_SHADER % "Nearest2D"
      )
      self.texture = gloo.Texture2D(img_array, interpolation="nearest")
  
      # using packed data as discussed in pr #1069
      self.kernel = gloo.Texture2D(kernel, interpolation="nearest")
      self.program["u_texture"] = self.texture
      self.program["u_shape"] = img_array.shape[1], img_array.shape[0]
      self.program["u_kernel"] = self.kernel
  
      self.names = names
      self.filter = 16
      self.title = (
          "Spatial Filtering using %s Filter" % self.names[self.filter]
      )
  
      self.program.bind(gloo.VertexBuffer(data))
  
      self.context.set_clear_color("white")
      self.context.set_viewport(0, 0, 512, 512)
      self.show()
  
file_path: vispy/examples/gloo/spatial_filters.py
imports: import numpy
  from vispy.io import load_spatial_filters
  from vispy import gloo
  from vispy import app
  from vispy.util.logs import set_log_level
label_desc: Use image node_id 1 to create a new Canvas object from inherited base classes: app with example: obj = Canvas()