From f88878c20bc36c10894ba6d5b8d2940e00046fe7 Mon Sep 17 00:00:00 2001 From: homm Date: Sun, 9 Nov 2014 04:26:53 +0300 Subject: [PATCH] reflect changes in documentation --- PIL/Image.py | 19 ++++++------------- docs/handbook/concepts.rst | 22 +++++++++------------- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/PIL/Image.py b/PIL/Image.py index 82bed82ad..e3434dc56 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -1515,9 +1515,8 @@ class Image: (width, height). :param resample: An optional resampling filter. This can be one of :py:attr:`PIL.Image.NEAREST` (use nearest neighbour), - :py:attr:`PIL.Image.BILINEAR` (linear interpolation in a 2x2 - environment), :py:attr:`PIL.Image.BICUBIC` (cubic spline - interpolation in a 4x4 environment), or + :py:attr:`PIL.Image.BILINEAR` (linear interpolation), + :py:attr:`PIL.Image.BICUBIC` (cubic spline interpolation), or :py:attr:`PIL.Image.ANTIALIAS` (a high-quality downsampling filter). If omitted, or if the image has mode "1" or "P", it is set :py:attr:`PIL.Image.NEAREST`. @@ -1754,12 +1753,7 @@ class Image: :py:meth:`~PIL.Image.Image.draft` method to configure the file reader (where applicable), and finally resizes the image. - Note that the bilinear and bicubic filters in the current - version of PIL are not well-suited for thumbnail generation. - You should use :py:attr:`PIL.Image.ANTIALIAS` unless speed is much more - important than quality. - - Also note that this function modifies the :py:class:`~PIL.Image.Image` + Note that this function modifies the :py:class:`~PIL.Image.Image` object in place. If you need to use the full resolution image as well, apply this method to a :py:meth:`~PIL.Image.Image.copy` of the original image. @@ -1767,10 +1761,9 @@ class Image: :param size: Requested size. :param resample: Optional resampling filter. This can be one of :py:attr:`PIL.Image.NEAREST`, :py:attr:`PIL.Image.BILINEAR`, - :py:attr:`PIL.Image.BICUBIC`, or :py:attr:`PIL.Image.ANTIALIAS` - (best quality). If omitted, it defaults to - :py:attr:`PIL.Image.ANTIALIAS`. (was :py:attr:`PIL.Image.NEAREST` - prior to version 2.5.0) + :py:attr:`PIL.Image.BICUBIC`, or :py:attr:`PIL.Image.ANTIALIAS`. + If omitted, it defaults to :py:attr:`PIL.Image.ANTIALIAS`. + (was :py:attr:`PIL.Image.NEAREST` prior to version 2.5.0) :returns: None """ diff --git a/docs/handbook/concepts.rst b/docs/handbook/concepts.rst index b5e5e44c1..492ec5457 100644 --- a/docs/handbook/concepts.rst +++ b/docs/handbook/concepts.rst @@ -87,25 +87,21 @@ pixel, the Python Imaging Library provides four different resampling *filters*. Pick the nearest pixel from the input image. Ignore all other input pixels. ``BILINEAR`` - Use linear interpolation over a 2x2 environment in the input image. Note - that in the current version of PIL, this filter uses a fixed input - environment when downsampling. + For resize calculate the output pixel value using linear interpolation + on all pixels that may contribute to the output value. + For other transformations linear interpolation over a 2x2 environment + in the input image is used. ``BICUBIC`` - Use cubic interpolation over a 4x4 environment in the input image. Note - that in the current version of PIL, this filter uses a fixed input - environment when downsampling. + For resize calculate the output pixel value using cubic interpolation + on all pixels that may contribute to the output value. + For other transformations cubic interpolation over a 4x4 environment + in the input image is used. ``ANTIALIAS`` - Calculate the output pixel value using a high-quality resampling filter (a + Calculate the output pixel value using a high-quality Lanczos filter (a truncated sinc) on all pixels that may contribute to the output value. In the current version of PIL, this filter can only be used with the resize and thumbnail methods. .. versionadded:: 1.1.3 - -Note that in the current version of PIL, the ``ANTIALIAS`` filter is the only -filter that behaves properly when downsampling (that is, when converting a -large image to a small one). The ``BILINEAR`` and ``BICUBIC`` filters use a -fixed input environment, and are best used for scale-preserving geometric -transforms and upsamping.