From 11c9e6c0dde4ba3ef63847edac822a488b383b38 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 14 Sep 2019 21:39:58 +1000 Subject: [PATCH 1/2] Added release notes [ci skip] --- docs/releasenotes/6.2.0.rst | 67 +++++++++++++++++++++++++++++++++++++ docs/releasenotes/index.rst | 1 + 2 files changed, 68 insertions(+) create mode 100644 docs/releasenotes/6.2.0.rst diff --git a/docs/releasenotes/6.2.0.rst b/docs/releasenotes/6.2.0.rst new file mode 100644 index 000000000..ff82e4b8a --- /dev/null +++ b/docs/releasenotes/6.2.0.rst @@ -0,0 +1,67 @@ +6.2.0 +----- + +API Additions +============= + +Text stroking +^^^^^^^^^^^^^ + +``stroke_width`` and ``stroke_fill`` arguments have been added to text drawing +operations. They allow text to be outlined, setting the width of the stroke and +and the color respectively. If not provided, ``stroke_fill`` will default to +the ``fill`` parameter. + +.. code-block:: python + + from PIL import Image, ImageDraw, ImageFont + + font = ImageFont.truetype("Tests/fonts/FreeMono.ttf", 40) + font.getsize_multiline("A", stroke_width=2) + font.getsize("ABC\nAaaa", stroke_width=2) + + im = Image.new("RGB", (100, 100)) + draw = ImageDraw.Draw(im) + draw.textsize("A", font, stroke_width=2) + draw.multiline_textsize("ABC\nAaaa", font, stroke_width=2) + draw.text((10, 10), "A", "#f00", font, stroke_width=2, stroke_fill="#0f0") + draw.multiline_text((10, 10), "A\nB", "#f00", font, + stroke_width=2, stroke_fill="#0f0") + +API Changes +=========== + +Image.getexif +^^^^^^^^^^^^^ + +To allow for lazy loading of Exif data, ``Image.getexif()`` now returns a +shared instance of ``Image.Exif``. + +Deprecations +^^^^^^^^^^^^ + +Python 2.7 +~~~~~~~~~~ + +Python 2.7 reaches end-of-life on 2020-01-01. + +Pillow 7.0.0 will be released on 2020-01-01 and will drop support for Python +2.7, making Pillow 6.2.x the last release series to support Python 2. + +Other Changes +============= + +Removed bdist_wininst .exe installers +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.exe installers fell out of favour with PEP 527, and will be deprecated in +Python 3.8. Pillow will no longer be distributing them. Wheels should be used +instead. + +Flags for libwebp in wheels +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +When building libwebp for inclusion in wheels, Pillow now adds the -O3 and +-DNDEBUG CFLAGS. These flags would be used by default if building libwebp +without debugging, and using them fixes a significant decrease in speed when +a wheel-installed copy of Pillow performs libwebp operations. diff --git a/docs/releasenotes/index.rst b/docs/releasenotes/index.rst index 400288883..76c0321e7 100644 --- a/docs/releasenotes/index.rst +++ b/docs/releasenotes/index.rst @@ -6,6 +6,7 @@ Release Notes .. toctree:: :maxdepth: 2 + 6.2.0 6.1.0 6.0.0 5.4.1 From 28f0940d5912c032c7fa9357feb2456fe68b4bab Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 15 Sep 2019 06:06:28 +1000 Subject: [PATCH 2/2] Added example image [ci skip] --- docs/releasenotes/6.2.0.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/releasenotes/6.2.0.rst b/docs/releasenotes/6.2.0.rst index ff82e4b8a..68d209f35 100644 --- a/docs/releasenotes/6.2.0.rst +++ b/docs/releasenotes/6.2.0.rst @@ -28,6 +28,22 @@ the ``fill`` parameter. draw.multiline_text((10, 10), "A\nB", "#f00", font, stroke_width=2, stroke_fill="#0f0") +For example, + +.. code-block:: python + + from PIL import Image, ImageDraw, ImageFont + + im = Image.new("RGB", (120, 130)) + draw = ImageDraw.Draw(im) + font = ImageFont.truetype("Tests/fonts/FreeMono.ttf", 120) + draw.text((10, 10), "A", "#f00", font, stroke_width=2, stroke_fill="#0f0") + + +creates the following image: + +.. image:: ../../Tests/images/imagedraw_stroke_different.png + API Changes ===========