From 0c248c68f2001071fdd9d9e00be4b04be15c0051 Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Wed, 20 Sep 2017 10:08:53 +0000 Subject: [PATCH 1/7] platform changes --- docs/installation.rst | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index f1029ae82..6a6a80fcb 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -339,6 +339,20 @@ Prerequisites are installed on **Fedora 23** with:: $ sudo dnf install libtiff-devel libjpeg-devel zlib-devel freetype-devel \ lcms2-devel libwebp-devel tcl-devel tk-devel libraqm-devel +See also the ``Dockerfile``s in the Test Infrastructure repo +(https://github.com/python-pillow/docker-images) for a known working +install process for other tested distros. + +Building on Android +^^^^^^^^^^^^^^^^^^^ + +Basic Android support has been added for compilation within the Termux +environment. The dependencies can be installed by:: + + $ pkg -y install python python-dev ndk-sysroot clang make \ + libjpeg-turbo-dev + +This has been tested within the Termux app on ChromeOS, on x86. Platform Support @@ -348,8 +362,7 @@ Current platform support for Pillow. Binary distributions are contributed for each release on a volunteer basis, but the source should compile and run everywhere platform support is listed. In general, we aim to support all current versions of Linux, macOS, and -Windows. Note that Android is not currently supported, but there have -been reports of success. +Windows. Continuous Integration Targets ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -369,6 +382,10 @@ These platforms are built and tested for every change. +----------------------------------+-------------------------------+-----------------------+ | Debian Stretch | 2.7 |x86 | +----------------------------------+-------------------------------+-----------------------+ +| Fedora 24 | 2.7 |x86-64 | ++----------------------------------+-------------------------------+-----------------------+ +| Fedora 26 | 2.7 |x86-64 | ++----------------------------------+-------------------------------+-----------------------+ | Mac OS X 10.10 Yosemite* | 2.7, 3.3, 3.4, 3.5, 3.6 |x86-64 | +----------------------------------+-------------------------------+-----------------------+ | Ubuntu Linux 16.04 LTS | 2.7 |x86-64 | @@ -380,7 +397,8 @@ These platforms are built and tested for every change. +----------------------------------+-------------------------------+-----------------------+ | Ubuntu Linux 12.04 LTS | 2.7 |x86-64 | +----------------------------------+-------------------------------+-----------------------+ -| Windows Server 2012 R2 | 2.7,3.3,3.4,pypy |x86, x86-64 | +| Windows Server 2012 R2 | 2.7,3.3,3.4 |x86, x86-64 | +| | pypy, 3.5/mingw |x86 | +----------------------------------+-------------------------------+-----------------------+ \* Mac OS X CI is not run for every commit, but is run for every release. From 997e10894686a8a3cbf2a29cec3cd8a712d93ae7 Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Wed, 20 Sep 2017 10:09:15 +0000 Subject: [PATCH 2/7] Deprecated easy_install in instructions --- docs/installation.rst | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index 6a6a80fcb..49788d633 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -32,12 +32,6 @@ Install Pillow with :command:`pip`:: $ pip install Pillow -Or use :command:`easy_install` for installing `Python Eggs -`_ as -:command:`pip` does not support them:: - - $ easy_install Pillow - Windows Installation ^^^^^^^^^^^^^^^^^^^^ @@ -49,10 +43,6 @@ libraries included:: > pip install Pillow -or:: - - > easy_install Pillow - macOS Installation ^^^^^^^^^^^^^^^^^^ From 505eb799baa5e9f7db11394ef2d076014b42471a Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Wed, 20 Sep 2017 10:47:35 +0000 Subject: [PATCH 3/7] fixed doc formatting error --- PIL/GifImagePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PIL/GifImagePlugin.py b/PIL/GifImagePlugin.py index 75158809d..a08063bfb 100644 --- a/PIL/GifImagePlugin.py +++ b/PIL/GifImagePlugin.py @@ -767,7 +767,7 @@ def getdata(im, offset=(0, 0), **params): :param im: Image object :param offset: Tuple of (x, y) pixels. Defaults to (0,0) - :param **params: E.g. duration or other encoder info parameters + :param \**params: E.g. duration or other encoder info parameters :returns: List of Bytes containing gif encoded frame data """ From ba101e4e62bdac21504fa08e9244801e3e1ae840 Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Wed, 20 Sep 2017 10:49:14 +0000 Subject: [PATCH 4/7] Fix docstring error --- PIL/ContainerIO.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PIL/ContainerIO.py b/PIL/ContainerIO.py index 609aa33e3..496ed6826 100644 --- a/PIL/ContainerIO.py +++ b/PIL/ContainerIO.py @@ -72,8 +72,7 @@ class ContainerIO(object): """ Read data. - @def read(bytes=0) - :param bytes: Number of bytes to read. If omitted or zero, + :param n: Number of bytes to read. If omitted or zero, read until end of region. :returns: An 8-bit string. """ From dc327121f1f0ceba521016937bba385afad1cd05 Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Wed, 20 Sep 2017 10:49:47 +0000 Subject: [PATCH 5/7] formatting --- docs/installation.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/installation.rst b/docs/installation.rst index 49788d633..95588de34 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -329,7 +329,7 @@ Prerequisites are installed on **Fedora 23** with:: $ sudo dnf install libtiff-devel libjpeg-devel zlib-devel freetype-devel \ lcms2-devel libwebp-devel tcl-devel tk-devel libraqm-devel -See also the ``Dockerfile``s in the Test Infrastructure repo +See also the ``Dockerfile``\s in the Test Infrastructure repo (https://github.com/python-pillow/docker-images) for a known working install process for other tested distros. @@ -388,6 +388,7 @@ These platforms are built and tested for every change. | Ubuntu Linux 12.04 LTS | 2.7 |x86-64 | +----------------------------------+-------------------------------+-----------------------+ | Windows Server 2012 R2 | 2.7,3.3,3.4 |x86, x86-64 | +| | | | | | pypy, 3.5/mingw |x86 | +----------------------------------+-------------------------------+-----------------------+ From 8172fa710b70dccef60fc5e47a4c26d442b46f29 Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Wed, 20 Sep 2017 10:54:59 +0000 Subject: [PATCH 6/7] Updated release notes --- docs/releasenotes/4.3.0.rst | 121 +++++++++++++++++++++++------------- 1 file changed, 77 insertions(+), 44 deletions(-) diff --git a/docs/releasenotes/4.3.0.rst b/docs/releasenotes/4.3.0.rst index e9ac8d936..f2e0f42b5 100644 --- a/docs/releasenotes/4.3.0.rst +++ b/docs/releasenotes/4.3.0.rst @@ -1,53 +1,19 @@ 4.3.0 ----- -Get One Channel From Image -========================== - -New method :py:meth:`PIL.Image.Image.getchannel` is added. -It returns single channel by index or name. For example, -``image.getchannel("A")`` will return alpha channel as separate image. -``getchannel`` should work up to 6 times faster than ``image.split()[0]`` -in previous Pillow versions. - - -Box Blur -======== - -New filter :py:class:`PIL.ImageFilter.BoxBlur` is added. - - -Partial Resampling -================== - -Added new argument ``box`` for :py:meth:`PIL.Image.Image.resize`. This -argument defines a source rectangle from within the source image to be -resized. This is very similar to the ``image.crop(box).resize(size)`` -sequence except that ``box`` can be specified with subpixel accuracy. - - -Loading 16-bit TIFF Images -========================== - -Pillow now can read 16-bit multichannel TIFF files including files -with alpha transparency. The image data is truncated to 8-bit -precision. - - -Performance +API Changes =========== -This release contains several performance improvements: - -* Many memory bandwidth-bounded operations such as crop, image allocation, - conversion, split into bands and merging from bands are up to 2x faster. -* Upscaling of multichannel images (such as RGB) is accelerated by 5-10% -* JPEG loading is accelerated up to 15% and JPEG saving up to 20% when - using a recent version of libjpeg-turbo. +Deprecations +^^^^^^^^^^^^ +Several undocumented functions in ImageOps have been deprecated: +``gaussian_blur``, ``gblur``, ``unsharp_mask``, ``usm`` and +``box_blur``. Use the equivalent operations in ImageFilter +instead. These functions will be removed in a future release. TIFF Metadata Changes -===================== +^^^^^^^^^^^^^^^^^^^^^ * TIFF tags with unknown type/quantity now default to being bare values if they are 1 element, where previously they would be a @@ -61,9 +27,8 @@ TIFF Metadata Changes items, as there can be multiple items, one for UTF-8, and one for UTF-16. - Core Image API Changes -====================== +^^^^^^^^^^^^^^^^^^^^^^ These are internal functions that should not have been used by user code, but they were accessible from the python layer. @@ -74,3 +39,71 @@ identified the format of the clipboard data. The ``PIL.Image.core.copy`` and ``PIL.Image.Image.im.copy2`` methods have been removed. + + +API Additions +============= + +Get One Channel From Image +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +A new method :py:meth:`PIL.Image.Image.getchannel` has been added to +return a single channel by index or name. For example, +``image.getchannel("A")`` will return alpha channel as separate image. +``getchannel`` should work up to 6 times faster than +``image.split()[0]`` in previous Pillow versions. + +Box Blur +^^^^^^^^ + +A new filter, :py:class:`PIL.ImageFilter.BoxBlur`, has been +added. This is a filter with similar results to a Gaussian blur, but +is much faster. + +Partial Resampling +^^^^^^^^^^^^^^^^^^ + +Added new argument ``box`` for :py:meth:`PIL.Image.Image.resize`. This +argument defines a source rectangle from within the source image to be +resized. This is very similar to the ``image.crop(box).resize(size)`` +sequence except that ``box`` can be specified with subpixel accuracy. + +New Transpose Operation +^^^^^^^^^^^^^^^^^^^^^^^ + +The ``Image.TRANSVERSE`` operation has been added to +:py:meth:`PIL.Image.Image.transpose`. This is equvalent to a transpose +operation about the opposite diagonal. + +Multiband Filters +^^^^^^^^^^^^^^^^^ + +There is a new :py:class:`PIL.ImageFilter.MultibandFilter` base class +for image filters that can run on all channels of an image in one +operation. The original :py:class:`PIL.ImageFilter.Filter` class +remains for image filters that can process only single band images, or +require splitting of channels prior to filtering. + + +Loading 16-bit TIFF Images +========================== + +Pillow now can read 16-bit multichannel TIFF files including files +with alpha transparency. The image data is truncated to 8-bit +precision. + +Performance +=========== + +This release contains several performance improvements: + +* Many memory bandwidth-bounded operations such as crop, image allocation, + conversion, split into bands and merging from bands are up to 2x faster. +* Upscaling of multichannel images (such as RGB) is accelerated by 5-10% +* JPEG loading is accelerated up to 15% and JPEG saving up to 20% when + using a recent version of libjpeg-turbo. +* ``Image.transpose`` has been accelerated 15% or more by using a cache + friendly algorithm. +* ImageFilters based on Kernel convolution are significantly faster + due to the new MultibandFilter feature. + From 6e2010e7fd36110baee086d86a8de5e333243e91 Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Wed, 20 Sep 2017 11:17:46 +0000 Subject: [PATCH 7/7] speling --- docs/releasenotes/4.3.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/releasenotes/4.3.0.rst b/docs/releasenotes/4.3.0.rst index f2e0f42b5..1463b34d6 100644 --- a/docs/releasenotes/4.3.0.rst +++ b/docs/releasenotes/4.3.0.rst @@ -72,7 +72,7 @@ New Transpose Operation ^^^^^^^^^^^^^^^^^^^^^^^ The ``Image.TRANSVERSE`` operation has been added to -:py:meth:`PIL.Image.Image.transpose`. This is equvalent to a transpose +:py:meth:`PIL.Image.Image.transpose`. This is equivalent to a transpose operation about the opposite diagonal. Multiband Filters