mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-24 17:06:16 +03:00
reflect changes in documentation
This commit is contained in:
parent
693aff7ee1
commit
f88878c20b
19
PIL/Image.py
19
PIL/Image.py
|
@ -1515,9 +1515,8 @@ class Image:
|
||||||
(width, height).
|
(width, height).
|
||||||
:param resample: An optional resampling filter. This can be
|
:param resample: An optional resampling filter. This can be
|
||||||
one of :py:attr:`PIL.Image.NEAREST` (use nearest neighbour),
|
one of :py:attr:`PIL.Image.NEAREST` (use nearest neighbour),
|
||||||
:py:attr:`PIL.Image.BILINEAR` (linear interpolation in a 2x2
|
:py:attr:`PIL.Image.BILINEAR` (linear interpolation),
|
||||||
environment), :py:attr:`PIL.Image.BICUBIC` (cubic spline
|
:py:attr:`PIL.Image.BICUBIC` (cubic spline interpolation), or
|
||||||
interpolation in a 4x4 environment), or
|
|
||||||
:py:attr:`PIL.Image.ANTIALIAS` (a high-quality downsampling filter).
|
:py:attr:`PIL.Image.ANTIALIAS` (a high-quality downsampling filter).
|
||||||
If omitted, or if the image has mode "1" or "P", it is
|
If omitted, or if the image has mode "1" or "P", it is
|
||||||
set :py:attr:`PIL.Image.NEAREST`.
|
set :py:attr:`PIL.Image.NEAREST`.
|
||||||
|
@ -1754,12 +1753,7 @@ class Image:
|
||||||
:py:meth:`~PIL.Image.Image.draft` method to configure the file reader
|
:py:meth:`~PIL.Image.Image.draft` method to configure the file reader
|
||||||
(where applicable), and finally resizes the image.
|
(where applicable), and finally resizes the image.
|
||||||
|
|
||||||
Note that the bilinear and bicubic filters in the current
|
Note that this function modifies the :py:class:`~PIL.Image.Image`
|
||||||
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`
|
|
||||||
object in place. If you need to use the full resolution image as well,
|
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
|
apply this method to a :py:meth:`~PIL.Image.Image.copy` of the original
|
||||||
image.
|
image.
|
||||||
|
@ -1767,10 +1761,9 @@ class Image:
|
||||||
:param size: Requested size.
|
:param size: Requested size.
|
||||||
:param resample: Optional resampling filter. This can be one
|
:param resample: Optional resampling filter. This can be one
|
||||||
of :py:attr:`PIL.Image.NEAREST`, :py:attr:`PIL.Image.BILINEAR`,
|
of :py:attr:`PIL.Image.NEAREST`, :py:attr:`PIL.Image.BILINEAR`,
|
||||||
:py:attr:`PIL.Image.BICUBIC`, or :py:attr:`PIL.Image.ANTIALIAS`
|
:py:attr:`PIL.Image.BICUBIC`, or :py:attr:`PIL.Image.ANTIALIAS`.
|
||||||
(best quality). If omitted, it defaults to
|
If omitted, it defaults to :py:attr:`PIL.Image.ANTIALIAS`.
|
||||||
:py:attr:`PIL.Image.ANTIALIAS`. (was :py:attr:`PIL.Image.NEAREST`
|
(was :py:attr:`PIL.Image.NEAREST` prior to version 2.5.0)
|
||||||
prior to version 2.5.0)
|
|
||||||
:returns: None
|
:returns: None
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -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.
|
Pick the nearest pixel from the input image. Ignore all other input pixels.
|
||||||
|
|
||||||
``BILINEAR``
|
``BILINEAR``
|
||||||
Use linear interpolation over a 2x2 environment in the input image. Note
|
For resize calculate the output pixel value using linear interpolation
|
||||||
that in the current version of PIL, this filter uses a fixed input
|
on all pixels that may contribute to the output value.
|
||||||
environment when downsampling.
|
For other transformations linear interpolation over a 2x2 environment
|
||||||
|
in the input image is used.
|
||||||
|
|
||||||
``BICUBIC``
|
``BICUBIC``
|
||||||
Use cubic interpolation over a 4x4 environment in the input image. Note
|
For resize calculate the output pixel value using cubic interpolation
|
||||||
that in the current version of PIL, this filter uses a fixed input
|
on all pixels that may contribute to the output value.
|
||||||
environment when downsampling.
|
For other transformations cubic interpolation over a 4x4 environment
|
||||||
|
in the input image is used.
|
||||||
|
|
||||||
``ANTIALIAS``
|
``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
|
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
|
the current version of PIL, this filter can only be used with the resize
|
||||||
and thumbnail methods.
|
and thumbnail methods.
|
||||||
|
|
||||||
.. versionadded:: 1.1.3
|
.. 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.
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user