add release notes

This commit is contained in:
Alexander 2019-12-21 01:17:08 +03:00
parent fc28182040
commit 59f8eeb290
2 changed files with 33 additions and 6 deletions

View File

@ -94,6 +94,33 @@ Custom unidentified image error
Pillow will now throw a custom ``UnidentifiedImageError`` when an image cannot be Pillow will now throw a custom ``UnidentifiedImageError`` when an image cannot be
identified. For backwards compatibility, this will inherit from ``IOError``. identified. For backwards compatibility, this will inherit from ``IOError``.
New argument ``reducing_gap`` for Image.resize() and Image.thumbnail() methods
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Speeds up resizing by resizing the image in two steps. The bigger ``reducing_gap``,
the closer the result to the fair resampling. The smaller ``reducing_gap``,
the faster resizing. With ``reducing_gap`` greater or equal to 3.0 result is
indistinguishable from fair resampling.
The default value for :py:meth:`~PIL.Image.Image.resize` is ``None``,
which means that the optimization is turned off by default.
The default value for :py:meth:`~PIL.Image.Image.thumbnail` is 2.0,
which is very close to fair resampling while still faster in many cases.
In addition, the same gap is applied when :py:meth:`~PIL.Image.Image.thumbnail`
calls :py:meth:`~PIL.Image.Image.draft`, which could greatly improve the quality
of JPEG thumbnails. As a result, :py:meth:`~PIL.Image.Image.thumbnail`
in the new version provides equally high speed and high quality from any
sources (JPEG or arbitrary images).
New Image.reduce() method
^^^^^^^^^^^^^^^^^^^^^^^^^
:py:meth:`~PIL.Image.Image.reduce` is a highly efficient operation
to reduce an image by integer times. Normally, shouldn't be used directly.
Used internally by :py:meth:`~PIL.Image.Image.resize` and :py:meth:`~PIL.Image.Image.thumbnail`
methods to speed up resize when a new argument ``reducing_gap`` is set.
Other Changes Other Changes
============= =============

View File

@ -1808,10 +1808,10 @@ class Image:
Second, resizing using regular resampling. The last step Second, resizing using regular resampling. The last step
changes size not less than in ``reducing_gap`` times. changes size not less than in ``reducing_gap`` times.
``reducing_gap`` could be None (no first step is performed) ``reducing_gap`` could be None (no first step is performed)
or should be greater than 1.0. The bigger `reducing_gap`, or should be greater than 1.0. The bigger ``reducing_gap``,
the closer the result to the fair resampling. the closer the result to the fair resampling.
The smaller `reducing_gap`, the faster resizing. The smaller ``reducing_gap``, the faster resizing.
With `reducing_gap` greater or equal to 3.0 result is With ``reducing_gap`` greater or equal to 3.0 result is
indistinguishable from fair resampling in most cases. indistinguishable from fair resampling in most cases.
The default value is None (no optimization). The default value is None (no optimization).
:returns: An :py:class:`~PIL.Image.Image` object. :returns: An :py:class:`~PIL.Image.Image` object.
@ -2223,10 +2223,10 @@ class Image:
Second, resizing using regular resampling. The last step Second, resizing using regular resampling. The last step
changes size not less than in ``reducing_gap`` times. changes size not less than in ``reducing_gap`` times.
``reducing_gap`` could be None (no first step is performed) ``reducing_gap`` could be None (no first step is performed)
or should be greater than 1.0. The bigger `reducing_gap`, or should be greater than 1.0. The bigger ``reducing_gap``,
the closer the result to the fair resampling. the closer the result to the fair resampling.
The smaller `reducing_gap`, the faster resizing. The smaller ``reducing_gap``, the faster resizing.
With `reducing_gap` greater or equal to 3.0 result is With ``reducing_gap`` greater or equal to 3.0 result is
indistinguishable from fair resampling in most cases. indistinguishable from fair resampling in most cases.
The default value is 2.0 (very close to fair resampling The default value is 2.0 (very close to fair resampling
while still faster in many cases). while still faster in many cases).