|
1 | 1 | 10.2.0 |
2 | 2 | ------ |
3 | 3 |
|
4 | | -Backwards Incompatible Changes |
5 | | -============================== |
6 | | - |
7 | | -TODO |
8 | | -^^^^ |
9 | | - |
10 | | -TODO |
11 | | - |
12 | 4 | Deprecations |
13 | 5 | ============ |
14 | 6 |
|
@@ -118,16 +110,43 @@ Saving TIFF tag RowsPerStrip |
118 | 110 | When saving TIFF images, the TIFF tag RowsPerStrip can now be one of the tags set by |
119 | 111 | the user, rather than always being calculated by Pillow. |
120 | 112 |
|
| 113 | +Optimized ImageColor.getrgb and getcolor |
| 114 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 115 | + |
| 116 | +The color calculations of :py:attr:`~PIL.ImageColor.getrgb` and |
| 117 | +:py:attr:`~PIL.ImageColor.getcolor` are now cached using |
| 118 | +:py:func:`functools.lru_cache`. Cached calls of ``getrgb`` are 3.1 - 91.4 times |
| 119 | +as fast and ``getcolor`` are 5.1 - 19.6 times as fast. |
| 120 | + |
| 121 | +Optimized ImageMode.getmode |
| 122 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 123 | + |
| 124 | +The lookups made by :py:attr:`~PIL.ImageMode.getmode` are now cached using |
| 125 | +:py:func:`functools.lru_cache` instead of a custom cache. Cached calls are 1.2 times as |
| 126 | +fast. |
| 127 | + |
121 | 128 | Optimized ImageStat.Stat count and extrema |
122 | 129 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
123 | 130 |
|
124 | 131 | Calculating the :py:attr:`~PIL.ImageStat.Stat.count` and |
125 | 132 | :py:attr:`~PIL.ImageStat.Stat.extrema` statistics is now faster. After the |
126 | | -histogram is created in ``st = ImageStat.Stat(im)``, ``st.count`` is 3x as fast |
127 | | -on average and ``st.extrema`` is 12x as fast on average. |
| 133 | +histogram is created in ``st = ImageStat.Stat(im)``, ``st.count`` is 3 times as fast on |
| 134 | +average and ``st.extrema`` is 12 times as fast on average. |
128 | 135 |
|
129 | 136 | Encoder errors now report error detail as string |
130 | 137 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
131 | 138 |
|
132 | 139 | :py:exc:`OSError` exceptions from image encoders now include a textual description of |
133 | 140 | the error instead of a numeric error code. |
| 141 | + |
| 142 | +Type hints |
| 143 | +^^^^^^^^^^ |
| 144 | + |
| 145 | +Work has begun to add type annotations to Pillow, including: |
| 146 | + |
| 147 | +* :py:mod:`~PIL.ContainerIO` |
| 148 | +* :py:mod:`~PIL.FontFile`, :py:mod:`~PIL.BdfFontFile` and :py:mod:`~PIL.PcfFontFile` |
| 149 | +* :py:mod:`~PIL.ImageChops` |
| 150 | +* :py:mod:`~PIL.ImageMode` |
| 151 | +* :py:mod:`~PIL.ImageSequence` |
| 152 | +* :py:mod:`~PIL.TarIO` |
0 commit comments