code: def frompil(self, pillow_image):
          
          bio = BytesIO()
          pillow_image.save(bio, format='png', compress_level=1)
          py_buffer = bio.getbuffer()
          c_buffer = ffi.from_buffer(py_buffer)
          with _LeptonicaErrorTrap():
              pix = Pix(lept.pixReadMem(c_buffer, len(c_buffer)))
              return pix
docs: Create a copy of a PIL.Image from this Pix