本文整理匯總了Python中Image.BILINEAR屬性的典型用法代碼示例。如果您正苦於以下問題:Python Image.BILINEAR屬性的具體用法?Python Image.BILINEAR怎麽用?Python Image.BILINEAR使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類Image
的用法示例。
在下文中一共展示了Image.BILINEAR屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: import Image [as 別名]
# 或者: from Image import BILINEAR [as 別名]
def __init__(self, size, interpolation=Image.BILINEAR):
self.size = size
self.interpolation = interpolation
示例2: deform
# 需要導入模塊: import Image [as 別名]
# 或者: from Image import BILINEAR [as 別名]
def deform(image, deformer, resample=Image.BILINEAR):
"Deform image using the given deformer"
return image.transform(
image.size, Image.MESH, deformer.getmesh(image), resample
)
##
# Equalize the image histogram. This function applies a non-linear
# mapping to the input image, in order to create a uniform
# distribution of grayscale values in the output image.
#
# @param image The image to equalize.
# @param mask An optional mask. If given, only the pixels selected by
# the mask are included in the analysis.
# @return An image.
示例3: _img_rotate
# 需要導入模塊: import Image [as 別名]
# 或者: from Image import BILINEAR [as 別名]
def _img_rotate(self, im, target, degree, bgcolor = '#ffffff', destformat = None):
"""
Rotate image. The ``degree`` argument is measured clock-wise.
"""
#rotated = im.convert('RGBA').rotate(angle=360-degree)
alpha = Image.new('RGBA', im.size, bgcolor)
alpha.paste(im)
rotated = alpha.rotate(angle=360-degree, resample=Image.BILINEAR)
bg = Image.new('RGBA', im.size, bgcolor)
result = Image.composite(rotated, bg, rotated)
self._saveimage(result, target, destformat if destformat else im.format)
示例4: __init__
# 需要導入模塊: import Image [as 別名]
# 或者: from Image import BILINEAR [as 別名]
def __init__(self, size, mode=Image.BILINEAR):
self.size = pair(size)
self.mode = mode