python
1コード 2def resize(self, size, resample=NEAREST): 3""" 4Returns a resized copy of this image. 5 6:param size: The requested size in pixels, as a 2-tuple: 7(width, height). 8:param resample: An optional resampling filter. This can be 9one of :py:attr:`PIL.Image.NEAREST`, :py:attr:`PIL.Image.BOX`, 10:py:attr:`PIL.Image.BILINEAR`, :py:attr:`PIL.Image.HAMMING`, 11:py:attr:`PIL.Image.BICUBIC` or :py:attr:`PIL.Image.LANCZOS`. 12If omitted, or if the image has mode "1" or "P", it is 13set :py:attr:`PIL.Image.NEAREST`. 14See: :ref:`concept-filters`. 15:returns: An :py:class:`~PIL.Image.Image` object. 16""" 17 18if resample not in ( 19NEAREST, BILINEAR, BICUBIC, LANCZOS, BOX, HAMMING, 20): 21raise ValueError("unknown resampling filter") 22 23self.load() 24 25size = tuple(size) 26if self.size == size: 27return self.copy() 28 29if self.mode in ("1", "P"): 30resample = NEAREST 31 32if self.mode == 'LA': 33return self.convert('La').resize(size, resample).convert('LA') 34 35if self.mode == 'RGBA': 36return self.convert('RGBa').resize(size, resample).convert('RGBA') 37 38return self._new(self.im.resize(size, resample))[リンク内容](http://pillow.readthedocs.io/en/4.2.x/releasenotes/2.7.0.html?highlight=antialias)
Image.ANTIALIASと記述するとLanczosでresizeされるらしいのですが具体的にどのような処理がされているのかがどこに記述されているか教えていただきたいです。
あなたの回答
tips
プレビュー