Python PIL.Image 模块,images() 实例源码
我们从Python开源项目中,提取了以下11个代码示例,用于说明如何使用PIL.Image.images()。
def loadImageSeries(filelist=None):
" create a list of Image.images for use in montage "
if filelist is None or len(filelist) < 1:
return
imglist = []
for img in filelist:
if not os.path.exists(img):
print("unable to find %s" % img)
continue
try:
im = Image.open(img).convert2byte()
except:
if not isspiderImage(img):
print(img + " is not a Spider image file")
continue
im.info['filename'] = img
imglist.append(im)
return imglist
# --------------------------------------------------------------------
# For saving images in Spider format
def loadImageSeries(filelist=None):
" create a list of Image.images for use in montage "
if filelist is None or len(filelist) < 1:
return
imglist = []
for img in filelist:
if not os.path.exists(img):
print("unable to find %s" % img)
continue
try:
im = Image.open(img).convert2byte()
except:
if not isspiderImage(img):
print(img + " is not a Spider image file")
continue
im.info['filename'] = img
imglist.append(im)
return imglist
# --------------------------------------------------------------------
# For saving images in Spider format
def loadImageSeries(filelist=None):
" create a list of Image.images for use in montage "
if filelist is None or len(filelist) < 1:
return
imglist = []
for img in filelist:
if not os.path.exists(img):
print("unable to find %s" % img)
continue
try:
im = Image.open(img).convert2byte()
except:
if not isspiderImage(img):
print(img + " is not a Spider image file")
continue
im.info['filename'] = img
imglist.append(im)
return imglist
# --------------------------------------------------------------------
# For saving images in Spider format
def loadImageSeries(filelist=None):
" create a list of Image.images for use in montage "
if filelist is None or len(filelist) < 1:
return
imglist = []
for img in filelist:
if not os.path.exists(img):
print("unable to find %s" % img)
continue
try:
im = Image.open(img).convert2byte()
except:
if not isspiderImage(img):
print(img + " is not a Spider image file")
continue
im.info['filename'] = img
imglist.append(im)
return imglist
# --------------------------------------------------------------------
# For saving images in Spider format
def loadImageSeries(filelist=None):
" create a list of Image.images for use in montage "
if filelist is None or len(filelist) < 1:
return
imglist = []
for img in filelist:
if not os.path.exists(img):
print("unable to find %s" % img)
continue
try:
im = Image.open(img).convert2byte()
except:
if not isspiderImage(img):
print(img + " is not a Spider image file")
continue
im.info['filename'] = img
imglist.append(im)
return imglist
# --------------------------------------------------------------------
# For saving images in Spider format
def loadImageSeries(filelist=None):
" create a list of Image.images for use in montage "
if filelist is None or len(filelist) < 1:
return
imglist = []
for img in filelist:
if not os.path.exists(img):
print("unable to find %s" % img)
continue
try:
im = Image.open(img).convert2byte()
except:
if not isspiderImage(img):
print(img + " is not a Spider image file")
continue
im.info['filename'] = img
imglist.append(im)
return imglist
# --------------------------------------------------------------------
# For saving images in Spider format
def loadImageSeries(filelist=None):
" create a list of Image.images for use in montage "
if filelist is None or len(filelist) < 1:
return
imglist = []
for img in filelist:
if not os.path.exists(img):
print("unable to find %s" % img)
continue
try:
im = Image.open(img).convert2byte()
except:
if not isspiderImage(img):
print(img + " is not a Spider image file")
continue
im.info['filename'] = img
imglist.append(im)
return imglist
# --------------------------------------------------------------------
# For saving images in Spider format
def loadImageSeries(filelist=None):
" create a list of Image.images for use in montage "
if filelist is None or len(filelist) < 1:
return
imglist = []
for img in filelist:
if not os.path.exists(img):
print("unable to find %s" % img)
continue
try:
im = Image.open(img).convert2byte()
except:
if not isspiderImage(img):
print(img + " is not a Spider image file")
continue
im.info['filename'] = img
imglist.append(im)
return imglist
# --------------------------------------------------------------------
# For saving images in Spider format
def loadImageSeries(filelist=None):
" create a list of Image.images for use in montage "
if filelist is None or len(filelist) < 1:
return
imglist = []
for img in filelist:
if not os.path.exists(img):
print("unable to find %s" % img)
continue
try:
im = Image.open(img).convert2byte()
except:
if not isspiderImage(img):
print(img + " is not a Spider image file")
continue
im.info['filename'] = img
imglist.append(im)
return imglist
# --------------------------------------------------------------------
# For saving images in Spider format
def loadImageSeries(filelist=None):
" create a list of Image.images for use in montage "
if filelist is None or len(filelist) < 1:
return
imglist = []
for img in filelist:
if not os.path.exists(img):
print("unable to find %s" % img)
continue
try:
im = Image.open(img).convert2byte()
except:
if not isspiderImage(img):
print(img + " is not a Spider image file")
continue
im.info['filename'] = img
imglist.append(im)
return imglist
# --------------------------------------------------------------------
# For saving images in Spider format
def loadImageSeries(filelist=None):
" create a list of Image.images for use in montage "
if filelist is None or len(filelist) < 1:
return
imglist = []
for img in filelist:
if not os.path.exists(img):
print("unable to find %s" % img)
continue
try:
im = Image.open(img).convert2byte()
except:
if not isspiderImage(img):
print(img + " is not a Spider image file")
continue
im.info['filename'] = img
imglist.append(im)
return imglist
# --------------------------------------------------------------------
# For saving images in Spider format