Filters comparison table

This commit is contained in:
homm 2016-06-30 15:21:45 +03:00
parent 4414d58334
commit fc448ddbdf

View File

@ -87,6 +87,8 @@ the file format handler (see the chapter on :ref:`image-file-formats`). Most
handlers add properties to the :py:attr:`~PIL.Image.Image.info` attribute when handlers add properties to the :py:attr:`~PIL.Image.Image.info` attribute when
loading an image, but ignore it when saving images. loading an image, but ignore it when saving images.
.. _concept-filters:
Filters Filters
------- -------
@ -110,8 +112,25 @@ pixel, the Python Imaging Library provides four different resampling *filters*.
``LANCZOS`` ``LANCZOS``
Calculate the output pixel value using a high-quality Lanczos 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.
the current version of PIL, this filter can only be used with the resize This filter can only be used with the :py:meth:`~PIL.Image.Image.resize`
and thumbnail methods. and :py:meth:`~PIL.Image.Image.thumbnail` methods.
.. versionadded:: 1.1.3 .. versionadded:: 1.1.3
Filters comparison table
~~~~~~~~~~~~~~~~~~~~~~~~
+------------+-------------+-----------+-------------+
| Filter | Downscaling | Upscaling | Performance |
| | quality | quality | |
+============+=============+===========+=============+
|``NEAREST`` | | | ⭐⭐⭐⭐⭐ |
+------------+-------------+-----------+-------------+
|``BILINEAR``| ⭐ | ⭐ | ⭐⭐⭐ |
+------------+-------------+-----------+-------------+
|``BICUBIC`` | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐ |
+------------+-------------+-----------+-------------+
|``LANCZOS`` | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐ |
+------------+-------------+-----------+-------------+