code: def get_rgb_image_as_bytes(self, format='png', quality=90):
          
          obuf = self.get_rgb_image_as_buffer(format=format, quality=quality)
          return bytes(obuf.getvalue())
docs: Get the current image shown in the viewer, with any overlaid
          graphics, in the form of a buffer in the form of bytes.
  
          Parameters
          ----------
          format : str
              See :meth:`get_rgb_image_as_buffer`.
  
          quality: int
              See :meth:`get_rgb_image_as_buffer`.
  
          Returns
          -------
          buffer : bytes
              The window contents as a buffer in the form of bytes.