From 8c38e4c6d5a5eed8d56dd807a263dbba6bf2204a Mon Sep 17 00:00:00 2001 From: Hugo Date: Mon, 31 Dec 2018 13:48:06 +0200 Subject: [PATCH 1/2] Update release notes --- docs/releasenotes/5.4.0.rst | 42 ++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/docs/releasenotes/5.4.0.rst b/docs/releasenotes/5.4.0.rst index 421ebbbf2a7..ad1b7e876cc 100644 --- a/docs/releasenotes/5.4.0.rst +++ b/docs/releasenotes/5.4.0.rst @@ -1,9 +1,29 @@ -5.4.0 (unreleased) +5.4.0 ----- API Changes =========== +APNG extension to PNG plugin +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Animated Portable Network Graphics (APNG) images are not fully supported but +can be opened via the PNG plugin to get some basic info:: + + im = Image.open("image.apng") + print(im.mode) # "RGBA" + print(im.size) # (245, 245) + im.show() # Shows a single frame + +Check for libjpeg-turbo +^^^^^^^^^^^^^^^^^^^^^^^ + +You can check if Pillow has been built against the libjpeg-turbo version of the +libjpeg library:: + + from PIL import features + features.check_feature("libjpeg_turbo") # True or False + Negative indexes in pixel access ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -15,6 +35,26 @@ For example, to get or set the farthest pixel in the lower right of an image:: px[-1, -1] = (0, 0, 0) +New custom TIFF tags +^^^^^^^^^^^^^^^^^^^^ + +TIFF images can now be saved with custom integer, float and sting TIFF tags:: + + im = Image.new("RGB", (200, 100)) + custom = { + 37000: 4, + 37001: 4.2, + 37002: "custom tag value", + 37003: u"custom tag value", + 37004: b"custom tag value", + } + im.save("output.tif", tiffinfo=custom) + + im2 = Image.open("output.tif") + print(im2.tag_v2[37000]) # 4 + print(im2.tag_v2[37002]) # "custom tag value" + print(im2.tag_v2[37004]) # b"custom tag value" + Other Changes ============= From a53c39eb46ca66ea7fb1c4fce71752989c86cb9a Mon Sep 17 00:00:00 2001 From: Andrew Murray <3112309+radarhere@users.noreply.github.com> Date: Mon, 31 Dec 2018 23:09:22 +0200 Subject: [PATCH 2/2] Fix typo Co-Authored-By: hugovk --- docs/releasenotes/5.4.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/releasenotes/5.4.0.rst b/docs/releasenotes/5.4.0.rst index ad1b7e876cc..6d7277c70ea 100644 --- a/docs/releasenotes/5.4.0.rst +++ b/docs/releasenotes/5.4.0.rst @@ -38,7 +38,7 @@ For example, to get or set the farthest pixel in the lower right of an image:: New custom TIFF tags ^^^^^^^^^^^^^^^^^^^^ -TIFF images can now be saved with custom integer, float and sting TIFF tags:: +TIFF images can now be saved with custom integer, float and string TIFF tags:: im = Image.new("RGB", (200, 100)) custom = {