docs: def toimage(self, width=None, height=None):
          '''Return the current scene as a PIL Image.
  
          **Example**
  
          You can build your molecular viewer as usual and dump an image
          at any resolution supported by the video card (up to the
          memory limits)::
  
              v = QtViewer()
  
              # Add the renderers
              v.add_renderer(...)
  
              # Add post processing effects
              v.add_post_processing(...)
  
              # Move the camera
              v.widget.camera.autozoom(...)
              v.widget.camera.orbit_x(...)
              v.widget.camera.orbit_y(...)
  
              # Save the image
              image = v.widget.toimage(1024, 768)
              image.save("mol.png")
  
  
          .. seealso::
  
              https://pillow.readthedocs.org/en/latest/PIL.html#module-PIL.Image
  
          '''
          from .postprocessing import NoEffect
          effect = NoEffect(self)
  
          self.post_processing.append(effect)
  
          oldwidth, oldheight = self.width(), self.height()
  
          #self.initializeGL()
  
          if None not in (width, height):
              self.resize(width, height)
              self.resizeGL(width, height)
          else:
              width = self.width()
              height = self.height()
  
          self.paintGL()
          self.post_processing.remove(effect)
          coltex = effect.texture
          coltex.bind()
          glActiveTexture(GL_TEXTURE0)
          data = glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE)
          image = pil_Image.frombuffer('RGBA', (width, height), data, 'raw', 'RGBA', 0, -1)
  
          #self.resize(oldwidth, oldheight)
          #self.resizeGL(oldwidth, oldheight)
  
          return image