Skip to content

Commit

Permalink
Refer to Resampling enum
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jan 6, 2023
1 parent b6c7a83 commit e47272d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/handbook/concepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,44 +148,44 @@ pixel, the Python Imaging Library provides different resampling *filters*.

.. py:currentmodule:: PIL.Image
.. data:: NEAREST
.. data:: Resampling.NEAREST

Pick one nearest pixel from the input image. Ignore all other input pixels.

.. data:: BOX
.. data:: Resampling.BOX

Each pixel of source image contributes to one pixel of the
destination image with identical weights.
For upscaling is equivalent of :data:`NEAREST`.
For upscaling is equivalent of :data:`Resampling.NEAREST`.
This filter can only be used with the :py:meth:`~PIL.Image.Image.resize`
and :py:meth:`~PIL.Image.Image.thumbnail` methods.

.. versionadded:: 3.4.0

.. data:: BILINEAR
.. data:: Resampling.BILINEAR

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.

.. data:: HAMMING
.. data:: Resampling.HAMMING

Produces a sharper image than :data:`BILINEAR`, doesn't have dislocations
on local level like with :data:`BOX`.
Produces a sharper image than :data:`Resampling.BILINEAR`, doesn't have
dislocations on local level like with :data:`Resampling.BOX`.
This filter can only be used with the :py:meth:`~PIL.Image.Image.resize`
and :py:meth:`~PIL.Image.Image.thumbnail` methods.

.. versionadded:: 3.4.0

.. data:: BICUBIC
.. data:: Resampling.BICUBIC

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.

.. data:: LANCZOS
.. data:: Resampling.LANCZOS

Calculate the output pixel value using a high-quality Lanczos filter (a
truncated sinc) on all pixels that may contribute to the output value.
Expand Down

0 comments on commit e47272d

Please sign in to comment.