From 2302b261b79477befa4382088755929df2c6872e Mon Sep 17 00:00:00 2001 From: Alex Clark Date: Sun, 1 Jul 2018 08:00:57 -0400 Subject: [PATCH 1/4] WS removal [ci skip] --- docs/releasenotes/5.2.0.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/releasenotes/5.2.0.rst b/docs/releasenotes/5.2.0.rst index e440be118..32defaee9 100644 --- a/docs/releasenotes/5.2.0.rst +++ b/docs/releasenotes/5.2.0.rst @@ -17,7 +17,6 @@ Pillow 6.0.0, and ``PILLOW_VERSION`` will be removed after that. Use ``PIL.__version__`` instead. - API Additions ============= From b9a62707a3a29ac6e38c683c10456db4a4bbbfd8 Mon Sep 17 00:00:00 2001 From: Alex Clark Date: Sun, 1 Jul 2018 08:14:59 -0400 Subject: [PATCH 2/4] Note reference to deprecations [ci skip] --- docs/releasenotes/5.2.0.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/releasenotes/5.2.0.rst b/docs/releasenotes/5.2.0.rst index 32defaee9..dac3d51c9 100644 --- a/docs/releasenotes/5.2.0.rst +++ b/docs/releasenotes/5.2.0.rst @@ -55,7 +55,7 @@ For example, this allows compilation with GCC 4.8 on NetBSD. Resolve confusion getting PIL / Pillow version string ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -As user gnbl notes in #3082: +Re: "version constants deprecated" listed above, as user gnbl notes in #3082: - it's confusing that PIL.VERSION returns the version string of the former PIL instead of Pillow's - there does not seem to be documentation on this version number (why this, will it ever change, ..) e.g. at https://pillow.readthedocs.io/en/5.1.x/about.html#why-a-fork @@ -63,6 +63,6 @@ As user gnbl notes in #3082: - the package information header is essentially useless (placeholder, does not even mention Pillow, nor the version) - PIL.version module documentation comment could explain how to access the version information -We have attempted to resolve these issues here: +We have attempted to resolve these issues: -- https://github.com/python-pillow/Pillow/pull/3218 +- https://github.com/python-pillow/Pillow/pull/3218 From c4f43b5b4ca3f2fb4d1b0c849b470b23e64b9e7e Mon Sep 17 00:00:00 2001 From: Hugo Date: Sun, 1 Jul 2018 19:56:04 +0300 Subject: [PATCH 3/4] Mention the other two version PRs --- docs/releasenotes/5.2.0.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/releasenotes/5.2.0.rst b/docs/releasenotes/5.2.0.rst index dac3d51c9..bceb43d25 100644 --- a/docs/releasenotes/5.2.0.rst +++ b/docs/releasenotes/5.2.0.rst @@ -61,8 +61,6 @@ Re: "version constants deprecated" listed above, as user gnbl notes in #3082: - there does not seem to be documentation on this version number (why this, will it ever change, ..) e.g. at https://pillow.readthedocs.io/en/5.1.x/about.html#why-a-fork - it's confusing that PIL.version is a module and does not return the version information directly or hints on how to get it - the package information header is essentially useless (placeholder, does not even mention Pillow, nor the version) -- PIL.version module documentation comment could explain how to access the version information +- PIL._version module documentation comment could explain how to access the version information -We have attempted to resolve these issues: - -- https://github.com/python-pillow/Pillow/pull/3218 +We have attempted to resolve these issues in #3083, #3090 and #3218. From a2c6a5a38e0a9c63ae51fea98de3823fc540ef82 Mon Sep 17 00:00:00 2001 From: Hugo Date: Sun, 1 Jul 2018 22:24:35 +0300 Subject: [PATCH 4/4] Update CHANGES, image-file-formats and release notes [CI skip] --- CHANGES.rst | 35 ++++++++++++++++++++- docs/handbook/image-file-formats.rst | 4 +-- docs/releasenotes/5.2.0.rst | 47 ++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 1e14e32bd..0c31eb3c7 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,9 +2,42 @@ Changelog (Pillow) ================== -5.2.0 (unreleased) +5.2.0 (2018-07-01) ------------------ +- Fixed saving a multiframe image as a single frame PDF #3137 + [radarhere] + +- If a Qt version is already imported, attempt to use it first #3143 + [radarhere] + +- Fix transform fill color for alpha images #3147 + [fozcode] + +- TGA: Add support for writing RLE data #3186 + [danpla] + +- TGA: Read and write LA data #3178 + [danpla] + +- QuantOctree.c: Remove erroneous attempt to average over an empty range #3196 + [tkoeppe] + +- Changed ICNS format tests to pass on OS X 10.11 #3202 + [radarhere] + +- Fixed bug in ImageDraw.multiline_textsize() #3114 + [tianyu139] + +- Added getsize_multiline support for PIL.ImageFont #3113 + [tianyu139] + +- Added ImageFile get_format_mimetype method #3190 + [radarhere] + +- Changed mmap file pointer to use context manager #3216 + [radarhere] + - Changed ellipse point calculations to be more evenly distributed #3142 [radarhere] diff --git a/docs/handbook/image-file-formats.rst b/docs/handbook/image-file-formats.rst index ae077a649..1b0661df1 100644 --- a/docs/handbook/image-file-formats.rst +++ b/docs/handbook/image-file-formats.rst @@ -562,8 +562,8 @@ TGA ^^^ PIL reads and writes TGA images containing ``L``, ``LA``, ``P``, -``RGB``, and ``RGBA`` data. PIL can read both uncompressed and -run-length encoded TGAs, but writes only uncompressed data. +``RGB``, and ``RGBA`` data. PIL can read and write both uncompressed and +run-length encoded TGAs. TIFF ^^^^ diff --git a/docs/releasenotes/5.2.0.rst b/docs/releasenotes/5.2.0.rst index bceb43d25..75e8da655 100644 --- a/docs/releasenotes/5.2.0.rst +++ b/docs/releasenotes/5.2.0.rst @@ -20,6 +20,46 @@ Use ``PIL.__version__`` instead. API Additions ============= +3D color lookup tables +^^^^^^^^^^^^^^^^^^^^^^ + +Support for 3D color lookup table transformations has been added. + +* https://en.wikipedia.org/wiki/3D_lookup_table + +``Color3DLUT.generate`` transforms 3-channel pixels using the values of the +channels as coordinates in the 3D lookup table and interpolating the nearest +elements. + +It allows you to apply almost any color transformation in constant time by +using pre-calculated decimated tables. + +``Color3DLUT.transform()`` allows altering table values with a callback. + +If NumPy is installed, the performance of argument conversion is dramatically +improved when a source table supports buffer interface (NumPy && arrays in +Python >= 3). + +ImageColor.getrgb +^^^^^^^^^^^^^^^^^ + +Previously ``Image.rotate`` only supported HSL color strings. Now HSB and HSV +strings are also supported, as well as float values. For example, +``ImageColor.getrgb("hsv(180,100%,99.5%)")``. + +ImageFile.get_format_mimetype +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +``ImageFile.get_format_mimetype`` has been added to return the MIME type of an +image file, where available. For example, +``Image.open("hopper.jpg").get_format_mimetype()`` returns ``"image/jpeg"``. + +ImageFont.getsize_multiline +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +A new method to return the size of multiline text, for example +``font.getsize_multiline("ABC\nAaaa")`` + Image.rotate ^^^^^^^^^^^^ @@ -28,6 +68,13 @@ color specifies the background color to use in the area outside the rotated image. This parameter takes the same color specifications as used in ``Image.new``. + +TGA file format +^^^^^^^^^^^^^^^ + +Pillow can now read and write LA data (in addition to L, P, RGB and RGBA), and +write RLE data (in addition to uncompressed). + Other Changes =============