From 66241cacc1751c4f7a08027819a27334dfe888b8 Mon Sep 17 00:00:00 2001 From: Hugo Date: Mon, 1 Jul 2019 09:11:09 +0300 Subject: [PATCH 1/3] Add release notes for #3608 and #3861 --- docs/releasenotes/6.1.0.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/releasenotes/6.1.0.rst b/docs/releasenotes/6.1.0.rst index 851dcb2d0a4..edc59a654b8 100644 --- a/docs/releasenotes/6.1.0.rst +++ b/docs/releasenotes/6.1.0.rst @@ -4,6 +4,14 @@ API Additions ============= +Image.entropy +^^^^^^^^^^^^^ +Calculates and returns the entropy for the image. A bilevel image (mode "1") is treated +as a greyscale ("L") image by this method. If a mask is provided, the method employs +the histogram for those parts of the image where the mask image is non-zero. The mask +image must have the same size as the image, and be either a bi-level image (mode "1") or +a greyscale image ("L"). + ImageGrab.grab ^^^^^^^^^^^^^^ @@ -40,6 +48,19 @@ ImageTk.getimage This function is now supported. It returns the contents of an ``ImageTk.PhotoImage`` as an RGBA ``Image.Image`` instance. +Improve encoding of TIFF tags +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The TIFF encoder supports more types, especially arrays. This is required for the +GeoTIFF format which encodes geospatial information. + +* Pass ``tagtype`` from v2 directory to libtiff encoder, instead of autodetecting type. +* Use explicit types eg. ``uint32_t`` for ``TIFF_LONG`` to fix issues on platforms with + 64-bit longs. +* Add support for multiple values (arrays). Requires type in v2 directory and values + must be passed as a tuple. +* Add support for signed types eg. ``TIFFTypes.TIFF_SIGNED_SHORT``. + Top To Bottom Complex Text Rendering ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From a2919f98ff713fbc28c28e5def9d90db0bf7ccca Mon Sep 17 00:00:00 2001 From: Hugo Date: Mon, 1 Jul 2019 10:05:57 +0300 Subject: [PATCH 2/3] Add #3928 to release notes, and #3928 and #3929 to CHANGES --- CHANGES.rst | 6 ++++++ docs/releasenotes/6.1.0.rst | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 25f1d830feb..882ef38917e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,12 @@ Changelog (Pillow) 6.1.0 (unreleased) ------------------ +- Deprecate Image.__del__ #3929 + [jdufresne] + +- Respect the PKG_CONFIG environment variable when building #3928 + [chewi] + - Improve encoding of TIFF tags #3861 [olt] diff --git a/docs/releasenotes/6.1.0.rst b/docs/releasenotes/6.1.0.rst index edc59a654b8..66b805253b5 100644 --- a/docs/releasenotes/6.1.0.rst +++ b/docs/releasenotes/6.1.0.rst @@ -61,8 +61,14 @@ GeoTIFF format which encodes geospatial information. must be passed as a tuple. * Add support for signed types eg. ``TIFFTypes.TIFF_SIGNED_SHORT``. -Top To Bottom Complex Text Rendering +Respect PKG_CONFIG environment variable when building +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This variable is commonly used by other build systems and using it can help with +cross-compiling. Falls back to ``pkg-config`` as before. + +Top-to-bottom complex text rendering ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Drawing text in the 'ttb' direction with ImageFont has been significantly improved +Drawing text in the 'ttb' direction with ``ImageFont`` has been significantly improved and requires Raqm 0.7 or greater. From e62dcc3d48618f965324c02c27002ef59f468a7b Mon Sep 17 00:00:00 2001 From: Hugo Date: Mon, 1 Jul 2019 12:20:08 +0300 Subject: [PATCH 3/3] Add #3886 to release notes and CHANGES --- CHANGES.rst | 3 +++ docs/releasenotes/6.1.0.rst | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 882ef38917e..b84a449f4f5 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,9 @@ Changelog (Pillow) - Deprecate Image.__del__ #3929 [jdufresne] +- Tiff: Add support for JPEG quality #3886 + [olt] + - Respect the PKG_CONFIG environment variable when building #3928 [chewi] diff --git a/docs/releasenotes/6.1.0.rst b/docs/releasenotes/6.1.0.rst index 66b805253b5..9236813819c 100644 --- a/docs/releasenotes/6.1.0.rst +++ b/docs/releasenotes/6.1.0.rst @@ -48,6 +48,17 @@ ImageTk.getimage This function is now supported. It returns the contents of an ``ImageTk.PhotoImage`` as an RGBA ``Image.Image`` instance. +Image quality for JPEG compressed TIFF +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The TIFF encoder accepts a ``quality`` parameter for ``jpeg`` compressed TIFF files. A +value from 0 (worst) to 100 (best) controls the image quality, similar to the JPEG +encoder. The default is 75. For example: + +.. code-block:: python + + im.save("out.tif", compression="jpeg", quality=85) + Improve encoding of TIFF tags ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^