Pillow/docs/releasenotes/4.3.0.rst

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

139 lines
4.6 KiB
ReStructuredText
Raw Normal View History

4.3.0
-----
2017-09-20 13:54:59 +03:00
API Changes
2017-08-26 18:19:04 +03:00
===========
2017-09-20 13:54:59 +03:00
Deprecations
^^^^^^^^^^^^
2017-08-26 18:19:04 +03:00
2017-09-20 13:54:59 +03:00
Several undocumented functions in ImageOps have been deprecated:
``gaussian_blur``, ``gblur``, ``unsharp_mask``, ``usm`` and
2019-01-20 23:07:22 +03:00
``box_blur``. Use the equivalent operations in ``ImageFilter``
2017-09-20 13:54:59 +03:00
instead. These functions will be removed in a future release.
2017-08-26 18:19:04 +03:00
2017-09-14 22:16:14 +03:00
TIFF Metadata Changes
2017-09-20 13:54:59 +03:00
^^^^^^^^^^^^^^^^^^^^^
2017-09-14 22:16:14 +03:00
* TIFF tags with unknown type/quantity now default to being bare
values if they are 1 element, where previously they would be a
single element tuple. This is only with the new api, not the legacy
api. This normalizes the handling of fields, so that the metadata
with inferred or image specified counts are handled the same as
2018-01-27 09:04:46 +03:00
metadata with count specified in the TIFF spec.
2017-09-14 22:16:14 +03:00
* The ``PhotoshopInfo``, ``XMP``, and ``JPEGTables`` tags now have a
defined type (bytes) and a count of 1.
* The ``ImageJMetaDataByteCounts`` tag now has an arbitrary number of
items, as there can be multiple items, one for UTF-8, and one for
UTF-16.
2017-09-09 13:29:49 +03:00
Core Image API Changes
2017-09-20 13:54:59 +03:00
^^^^^^^^^^^^^^^^^^^^^^
2017-09-09 13:29:49 +03:00
These are internal functions that should not have been used by user
code, but they were accessible from the python layer.
Debugging code within ``Image.core.grabclipboard`` was removed. It had been
marked as ``will be removed in future versions`` since PIL. When enabled, it
identified the format of the clipboard data.
2017-08-26 18:19:04 +03:00
2017-09-09 13:29:49 +03:00
The ``PIL.Image.core.copy`` and ``PIL.Image.Image.im.copy2`` methods
have been removed.
2017-09-18 01:41:39 +03:00
The ``PIL.Image.core.getcount`` methods have been removed, use
``PIL.Image.core.get_stats()['new_count']`` property instead.
2017-09-20 13:54:59 +03:00
API Additions
=============
Get One Channel From Image
2017-09-20 13:54:59 +03:00
^^^^^^^^^^^^^^^^^^^^^^^^^^
2017-09-20 13:54:59 +03:00
A new method :py:meth:`PIL.Image.Image.getchannel` has been added to
return a single channel by index or name. For example,
2017-09-06 06:30:22 +03:00
``image.getchannel("A")`` will return alpha channel as separate image.
2017-09-20 13:54:59 +03:00
``getchannel`` should work up to 6 times faster than
``image.split()[0]`` in previous Pillow versions.
2017-08-26 18:19:04 +03:00
2017-09-15 00:55:19 +03:00
Box Blur
2017-09-20 13:54:59 +03:00
^^^^^^^^
2017-09-15 00:55:19 +03:00
2017-09-20 13:54:59 +03:00
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.
2017-09-15 00:55:19 +03:00
2017-08-26 18:19:04 +03:00
Partial Resampling
2017-09-20 13:54:59 +03:00
^^^^^^^^^^^^^^^^^^
2017-08-26 18:19:04 +03:00
2017-09-09 13:29:49 +03:00
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.
2017-08-26 18:19:04 +03:00
2017-09-20 13:54:59 +03:00
New Transpose Operation
^^^^^^^^^^^^^^^^^^^^^^^
The ``Image.TRANSVERSE`` operation has been added to
2017-09-20 14:17:46 +03:00
:py:meth:`PIL.Image.Image.transpose`. This is equivalent to a transpose
2017-09-20 13:54:59 +03:00
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
2018-01-27 09:04:46 +03:00
require splitting of channels prior to filtering.
2017-09-20 13:54:59 +03:00
2017-10-02 12:27:15 +03:00
Other Changes
=============
2017-08-26 18:19:04 +03:00
Loading 16-bit TIFF Images
2017-10-02 12:27:15 +03:00
^^^^^^^^^^^^^^^^^^^^^^^^^^
2017-08-26 18:19:04 +03:00
Pillow now can read 16-bit multichannel TIFF files including files
2017-09-09 13:29:49 +03:00
with alpha transparency. The image data is truncated to 8-bit
precision.
2017-08-26 18:19:04 +03:00
2017-10-02 12:27:15 +03:00
Pillow now can read 16-bit signed integer single channel TIFF
files. The image data is promoted to 32-bit for storage and
processing.
2017-10-02 14:49:53 +03:00
SGI Images
^^^^^^^^^^
Pillow can now read and write uncompressed 16-bit multichannel SGI
images to and from RGB and RGBA formats. The image data is truncated
to 8-bit precision.
Pillow can now read RLE encoded SGI images in both 8 and 16-bit
2018-01-27 09:04:46 +03:00
precision.
2017-10-02 14:49:53 +03:00
2017-08-26 18:19:04 +03:00
Performance
2017-10-02 12:27:15 +03:00
^^^^^^^^^^^
2017-08-26 18:19:04 +03:00
2017-09-09 13:29:49 +03:00
This release contains several performance improvements:
2017-08-26 18:19:04 +03:00
* Many memory bandwidth-bounded operations such as crop, image allocation,
2017-09-09 13:29:49 +03:00
conversion, split into bands and merging from bands are up to 2x faster.
2017-08-26 18:19:04 +03:00
* Upscaling of multichannel images (such as RGB) is accelerated by 5-10%
2017-09-09 13:29:49 +03:00
* JPEG loading is accelerated up to 15% and JPEG saving up to 20% when
using a recent version of libjpeg-turbo.
2017-09-20 13:54:59 +03:00
* ``Image.transpose`` has been accelerated 15% or more by using a cache
friendly algorithm.
* ImageFilters based on Kernel convolution are significantly faster
2020-07-09 21:23:19 +03:00
due to the new :py:class:`~PIL.ImageFilter.MultibandFilter` feature.
2017-10-02 12:27:15 +03:00
* All memory allocation for images is now done in blocks, rather than
falling back to an allocation for each scan line for images larger
than the block size.
CMYK Conversion
^^^^^^^^^^^^^^^
The basic CMYK->RGB conversion has been tweaked to match the formula
from Google Chrome. This produces an image that is generally lighter
than the previous formula, and more in line with what color managed
applications produce.