code: def show(self, fmt=None):
          
          # force any delayed redraws
          # TODO: this really needs to be addressed in get_rgb_image_as_bytes()
          # of the various superclasses, as it affects other backends as well
          self.redraw_now()
  
          from IPython.display import Image
  
          if fmt is None:
              # what format are we using for the HTML5 canvas--use that
              settings = self.get_settings()
              fmt = settings.get('html5_canvas_format', 'png')
  
          return Image(data=bytes(self.get_rgb_image_as_bytes(format=fmt)),
                       format=fmt, embed=True)
docs: Capture the window of a viewer.