|
| 1 | +6.2.0 |
| 2 | +----- |
| 3 | + |
| 4 | +API Additions |
| 5 | +============= |
| 6 | + |
| 7 | +Text stroking |
| 8 | +^^^^^^^^^^^^^ |
| 9 | + |
| 10 | +``stroke_width`` and ``stroke_fill`` arguments have been added to text drawing |
| 11 | +operations. They allow text to be outlined, setting the width of the stroke and |
| 12 | +and the color respectively. If not provided, ``stroke_fill`` will default to |
| 13 | +the ``fill`` parameter. |
| 14 | + |
| 15 | +.. code-block:: python |
| 16 | +
|
| 17 | + from PIL import Image, ImageDraw, ImageFont |
| 18 | +
|
| 19 | + font = ImageFont.truetype("Tests/fonts/FreeMono.ttf", 40) |
| 20 | + font.getsize_multiline("A", stroke_width=2) |
| 21 | + font.getsize("ABC\nAaaa", stroke_width=2) |
| 22 | +
|
| 23 | + im = Image.new("RGB", (100, 100)) |
| 24 | + draw = ImageDraw.Draw(im) |
| 25 | + draw.textsize("A", font, stroke_width=2) |
| 26 | + draw.multiline_textsize("ABC\nAaaa", font, stroke_width=2) |
| 27 | + draw.text((10, 10), "A", "#f00", font, stroke_width=2, stroke_fill="#0f0") |
| 28 | + draw.multiline_text((10, 10), "A\nB", "#f00", font, |
| 29 | + stroke_width=2, stroke_fill="#0f0") |
| 30 | +
|
| 31 | +For example, |
| 32 | + |
| 33 | +.. code-block:: python |
| 34 | +
|
| 35 | + from PIL import Image, ImageDraw, ImageFont |
| 36 | +
|
| 37 | + im = Image.new("RGB", (120, 130)) |
| 38 | + draw = ImageDraw.Draw(im) |
| 39 | + font = ImageFont.truetype("Tests/fonts/FreeMono.ttf", 120) |
| 40 | + draw.text((10, 10), "A", "#f00", font, stroke_width=2, stroke_fill="#0f0") |
| 41 | +
|
| 42 | +
|
| 43 | +creates the following image: |
| 44 | + |
| 45 | +.. image:: ../../Tests/images/imagedraw_stroke_different.png |
| 46 | + |
| 47 | +API Changes |
| 48 | +=========== |
| 49 | + |
| 50 | +Image.getexif |
| 51 | +^^^^^^^^^^^^^ |
| 52 | + |
| 53 | +To allow for lazy loading of Exif data, ``Image.getexif()`` now returns a |
| 54 | +shared instance of ``Image.Exif``. |
| 55 | + |
| 56 | +Deprecations |
| 57 | +^^^^^^^^^^^^ |
| 58 | + |
| 59 | +Python 2.7 |
| 60 | +~~~~~~~~~~ |
| 61 | + |
| 62 | +Python 2.7 reaches end-of-life on 2020-01-01. |
| 63 | + |
| 64 | +Pillow 7.0.0 will be released on 2020-01-01 and will drop support for Python |
| 65 | +2.7, making Pillow 6.2.x the last release series to support Python 2. |
| 66 | + |
| 67 | +Other Changes |
| 68 | +============= |
| 69 | + |
| 70 | +Removed bdist_wininst .exe installers |
| 71 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 72 | + |
| 73 | +.exe installers fell out of favour with PEP 527, and will be deprecated in |
| 74 | +Python 3.8. Pillow will no longer be distributing them. Wheels should be used |
| 75 | +instead. |
| 76 | + |
| 77 | +Flags for libwebp in wheels |
| 78 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 79 | + |
| 80 | +When building libwebp for inclusion in wheels, Pillow now adds the -O3 and |
| 81 | +-DNDEBUG CFLAGS. These flags would be used by default if building libwebp |
| 82 | +without debugging, and using them fixes a significant decrease in speed when |
| 83 | +a wheel-installed copy of Pillow performs libwebp operations. |
0 commit comments