reflect changes in documentation

This commit is contained in:
homm 2014-11-09 04:26:53 +03:00
parent 693aff7ee1
commit f88878c20b
2 changed files with 15 additions and 26 deletions

View File

@ -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
"""

View File

@ -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.