本文整理汇总了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