From 1bd9b16e97d03912f234ce266705dfb19953b84e Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 27 Dec 2019 15:35:17 +0300 Subject: [PATCH] wording --- docs/releasenotes/7.0.0.rst | 8 ++++---- src/PIL/Image.py | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/releasenotes/7.0.0.rst b/docs/releasenotes/7.0.0.rst index 26f9a8cbc..ae652278d 100644 --- a/docs/releasenotes/7.0.0.rst +++ b/docs/releasenotes/7.0.0.rst @@ -99,16 +99,16 @@ 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 faster resizing. With ``reducing_gap`` greater or equal to 3.0, +the 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. +which is very close to fair resampling while still being 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 +calls :py:meth:`~PIL.Image.Image.draft`, which may 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). diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 866c89831..a48c111fc 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -1767,8 +1767,8 @@ class Image: return m_im def _get_safe_box(self, size, resample, box): - """Expands the box so it includes neighboring pixels - that could be used by resampling with the given resampling filter. + """Expands the box so it includes adjacent pixels + that may be used by resampling with the given resampling filter. """ filter_support = _filters_support[resample] - 0.5 scale_x = (box[2] - box[0]) / size[0] @@ -1802,11 +1802,11 @@ class Image: The values must be within (0, 0, width, height) rectangle. If omitted or None, the entire source is used. :param reducing_gap: Apply optimization by resizing the image - in two steps. First, reducing the image in integer times + in two steps. First, reducing the image by integer times using :py:meth:`~PIL.Image.Image.reduce`. Second, resizing using regular resampling. The last step - changes size not less than in ``reducing_gap`` times. - ``reducing_gap`` could be None (no first step is performed) + changes size no less than by ``reducing_gap`` times. + ``reducing_gap`` may be None (no first step is performed) or should be greater than 1.0. The bigger ``reducing_gap``, the closer the result to the fair resampling. The smaller ``reducing_gap``, the faster resizing. @@ -2216,19 +2216,19 @@ class Image: If omitted, it defaults to :py:attr:`PIL.Image.BICUBIC`. (was :py:attr:`PIL.Image.NEAREST` prior to version 2.5.0). :param reducing_gap: Apply optimization by resizing the image - in two steps. First, reducing the image in integer times + in two steps. First, reducing the image by integer times using :py:meth:`~PIL.Image.Image.reduce` or :py:meth:`~PIL.Image.Image.draft` for JPEG images. Second, resizing using regular resampling. The last step - changes size not less than in ``reducing_gap`` times. - ``reducing_gap`` could be None (no first step is performed) + changes size no less than by ``reducing_gap`` times. + ``reducing_gap`` may be none (no first step is performed) or should be greater than 1.0. 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 in most cases. The default value is 2.0 (very close to fair resampling - while still faster in many cases). + while still being faster in many cases). :returns: None """