code: def _repr_png_(self):
          
          app.process_events()
          QApplication.processEvents()
  
          img = read_pixels()
          return bytes(_make_png(img))
docs: This is used by ipython to plot inline.