code: def open(cls, path):
          
          filename = fspath(path)
          with _LeptonicaErrorTrap():
              return cls(lept.pixRead(os.fsencode(filename)))
docs: Load an image file into a PIX object.
  
          Leptonica can load TIFF, PNM (PBM, PGM, PPM), PNG, and JPEG.  If
          loading fails then the object will wrap a C null pointer.