当前位置: 首页>>代码示例>>Python>>正文


Python Image.NONE属性代码示例

本文整理汇总了Python中PIL.Image.NONE属性的典型用法代码示例。如果您正苦于以下问题:Python Image.NONE属性的具体用法?Python Image.NONE怎么用?Python Image.NONE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在PIL.Image的用法示例。


在下文中一共展示了Image.NONE属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from PIL import Image [as 别名]
# 或者: from PIL.Image import NONE [as 别名]
def __init__(self, interpolation):
        if Image is None:
            raise ImportError(
                'pillow backend for resize operation requires TensorFlow. Please install it before usage.'
            )
        self._supported_interpolations = {
            'NEAREST': Image.NEAREST,
            'NONE': Image.NONE,
            'BILINEAR': Image.BILINEAR,
            'LINEAR': Image.LINEAR,
            'BICUBIC': Image.BICUBIC,
            'CUBIC': Image.CUBIC,
            'ANTIALIAS': Image.ANTIALIAS,
        }
        try:
            optional_interpolations = {
                'BOX': Image.BOX,
                'LANCZOS': Image.LANCZOS,
                'HAMMING': Image.HAMMING,
            }
            self._supported_interpolations.update(optional_interpolations)
        except AttributeError:
            pass
        super().__init__(interpolation) 
开发者ID:opencv,项目名称:open_model_zoo,代码行数:26,代码来源:resize.py

示例2: supported_interpolations

# 需要导入模块: from PIL import Image [as 别名]
# 或者: from PIL.Image import NONE [as 别名]
def supported_interpolations(cls):
        if Image is None:
            return {}
        intrp = {
            'NEAREST': Image.NEAREST,
            'NONE': Image.NONE,
            'BILINEAR': Image.BILINEAR,
            'LINEAR': Image.LINEAR,
            'BICUBIC': Image.BICUBIC,
            'CUBIC': Image.CUBIC,
            'ANTIALIAS': Image.ANTIALIAS
        }
        try:
            optional_interpolations = {
                'BOX': Image.BOX,
                'LANCZOS': Image.LANCZOS,
                'HAMMING': Image.HAMMING,
            }
            intrp.update(optional_interpolations)
        except AttributeError:
            pass
        return intrp 
开发者ID:opencv,项目名称:open_model_zoo,代码行数:24,代码来源:resize.py

示例3: apply_thumbnail_effects

# 需要导入模块: from PIL import Image [as 别名]
# 或者: from PIL.Image import NONE [as 别名]
def apply_thumbnail_effects(image, palette, dither):
    '''Apply effects on the reduced image before Legofying'''
    palette_image = Image.new("P", (1, 1))
    palette_image.putpalette(palette)
    return image.im.convert("P",
                        Image.FLOYDSTEINBERG if dither else Image.NONE,
                        palette_image.im) 
开发者ID:JuanPotato,项目名称:Legofy,代码行数:9,代码来源:__init__.py

示例4: _convert2pilp

# 需要导入模块: from PIL import Image [as 别名]
# 或者: from PIL.Image import NONE [as 别名]
def _convert2pilp(im):
    Image = _getImage()
    return im.convert("P", dither=Image.NONE, palette=Image.ADAPTIVE) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:5,代码来源:renderPM.py

示例5: drawToPILP

# 需要导入模块: from PIL import Image [as 别名]
# 或者: from PIL.Image import NONE [as 别名]
def drawToPILP(d, dpi=72, bg=0xffffff, configPIL=None, showBoundary=rl_config._unset_):
    Image = _getImage()
    im = drawToPIL(d, dpi=dpi, bg=bg, configPIL=configPIL, showBoundary=showBoundary)
    return im.convert("P", dither=Image.NONE, palette=Image.ADAPTIVE) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:6,代码来源:renderPM.py

示例6: imageToVector

# 需要导入模块: from PIL import Image [as 别名]
# 或者: from PIL.Image import NONE [as 别名]
def imageToVector(image):
  '''
  Returns a bit vector representation (list of ints) of a PIL image.
  '''
  # Convert the image to black and white
  image = image.convert('1',dither=Image.NONE)
  # Pull out the data, turn that into a list, then a numpy array,
  # then convert from 0 255 space to binary with a threshold.
  # Finally cast the values into a type CPP likes
  vector = (numpy.array(list(image.getdata())) < 100).astype('uint32')

  return vector 
开发者ID:numenta,项目名称:nupic.vision,代码行数:14,代码来源:image_encoders.py


注:本文中的PIL.Image.NONE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。