當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。