mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 10:26:19 +03:00
Merge pull request #7665 from hugovk/update-release-notes
Release notes: add `ImageColor` and `ImageMode` optimisations, and type hints
This commit is contained in:
commit
1469e433b6
|
@ -69,6 +69,14 @@ can be found here.
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
|
||||||
|
:mod:`~PIL.ImageMode` Module
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
.. automodule:: PIL.ImageMode
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
:mod:`~PIL.ImageTransform` Module
|
:mod:`~PIL.ImageTransform` Module
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,6 @@
|
||||||
10.2.0
|
10.2.0
|
||||||
------
|
------
|
||||||
|
|
||||||
Backwards Incompatible Changes
|
|
||||||
==============================
|
|
||||||
|
|
||||||
TODO
|
|
||||||
^^^^
|
|
||||||
|
|
||||||
TODO
|
|
||||||
|
|
||||||
Deprecations
|
Deprecations
|
||||||
============
|
============
|
||||||
|
|
||||||
|
@ -118,16 +110,43 @@ Saving TIFF tag RowsPerStrip
|
||||||
When saving TIFF images, the TIFF tag RowsPerStrip can now be one of the tags set by
|
When saving TIFF images, the TIFF tag RowsPerStrip can now be one of the tags set by
|
||||||
the user, rather than always being calculated by Pillow.
|
the user, rather than always being calculated by Pillow.
|
||||||
|
|
||||||
|
Optimized ImageColor.getrgb and getcolor
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
The color calculations of :py:attr:`~PIL.ImageColor.getrgb` and
|
||||||
|
:py:attr:`~PIL.ImageColor.getcolor` are now cached using
|
||||||
|
:py:func:`functools.lru_cache`. Cached calls of ``getrgb`` are 3.1 - 91.4 times
|
||||||
|
as fast and ``getcolor`` are 5.1 - 19.6 times as fast.
|
||||||
|
|
||||||
|
Optimized ImageMode.getmode
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
The lookups made by :py:attr:`~PIL.ImageMode.getmode` are now cached using
|
||||||
|
:py:func:`functools.lru_cache` instead of a custom cache. Cached calls are 1.2 times as
|
||||||
|
fast.
|
||||||
|
|
||||||
Optimized ImageStat.Stat count and extrema
|
Optimized ImageStat.Stat count and extrema
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Calculating the :py:attr:`~PIL.ImageStat.Stat.count` and
|
Calculating the :py:attr:`~PIL.ImageStat.Stat.count` and
|
||||||
:py:attr:`~PIL.ImageStat.Stat.extrema` statistics is now faster. After the
|
:py:attr:`~PIL.ImageStat.Stat.extrema` statistics is now faster. After the
|
||||||
histogram is created in ``st = ImageStat.Stat(im)``, ``st.count`` is 3x as fast
|
histogram is created in ``st = ImageStat.Stat(im)``, ``st.count`` is 3 times as fast on
|
||||||
on average and ``st.extrema`` is 12x as fast on average.
|
average and ``st.extrema`` is 12 times as fast on average.
|
||||||
|
|
||||||
Encoder errors now report error detail as string
|
Encoder errors now report error detail as string
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
:py:exc:`OSError` exceptions from image encoders now include a textual description of
|
:py:exc:`OSError` exceptions from image encoders now include a textual description of
|
||||||
the error instead of a numeric error code.
|
the error instead of a numeric error code.
|
||||||
|
|
||||||
|
Type hints
|
||||||
|
^^^^^^^^^^
|
||||||
|
|
||||||
|
Work has begun to add type annotations to Pillow, including:
|
||||||
|
|
||||||
|
* :py:mod:`~PIL.ContainerIO`
|
||||||
|
* :py:mod:`~PIL.FontFile`, :py:mod:`~PIL.BdfFontFile` and :py:mod:`~PIL.PcfFontFile`
|
||||||
|
* :py:mod:`~PIL.ImageChops`
|
||||||
|
* :py:mod:`~PIL.ImageMode`
|
||||||
|
* :py:mod:`~PIL.ImageSequence`
|
||||||
|
* :py:mod:`~PIL.TarIO`
|
||||||
|
|
Loading…
Reference in New Issue
Block a user