From 2a7ad14172e8c88c4d30bb698cc569d8d07234c2 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Thu, 5 Sep 2019 20:10:43 +1000 Subject: [PATCH 1/4] Added more limited support modes [ci skip] --- docs/handbook/concepts.rst | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/docs/handbook/concepts.rst b/docs/handbook/concepts.rst index 055821a15cf..a254d11c329 100644 --- a/docs/handbook/concepts.rst +++ b/docs/handbook/concepts.rst @@ -44,11 +44,24 @@ supports the following standard modes: * ``I`` (32-bit signed integer pixels) * ``F`` (32-bit floating point pixels) -PIL also provides limited support for a few special modes, including ``LA`` (L -with alpha), ``RGBX`` (true color with padding) and ``RGBa`` (true color with -premultiplied alpha). However, PIL doesn’t support user-defined modes; if you -need to handle band combinations that are not listed above, use a sequence of -Image objects. +PIL also provides limited support for a few special modes, including: + + * ``LA`` (L with alpha) + * ``PA`` (P with alpha) + * ``RGBX`` (true color with padding) + * ``RGBa`` (true color with premultiplied alpha) + * ``La`` (L with premultiplied alpha) + * ``I;16`` (16-bit unsigned integer pixels) + * ``I;16L`` (16-bit little endian unsigned integer pixels) + * ``I;16B`` (16-bit big endian unsigned integer pixels) + * ``I;16N`` (16-bit native endian unsigned integer pixels) + * ``BGR;15`` (15-bit reversed true colour) + * ``BGR;16`` (16-bit reversed true colour) + * ``BGR;24`` (24-bit reversed true colour) + * ``BGR;32`` (32-bit reversed true colour) + +However, PIL doesn’t support user-defined modes; if you need to handle band +combinations that are not listed above, use a sequence of Image objects. You can read the mode of an image through the :py:attr:`~PIL.Image.Image.mode` attribute. This is a string containing one of the above values. From dea75d1210b1ca91cebf46208ba9d0d4598de442 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Thu, 5 Sep 2019 20:11:02 +1000 Subject: [PATCH 2/4] Corrected comment --- src/libImaging/Storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libImaging/Storage.c b/src/libImaging/Storage.c index 389089e118e..ab476939ac0 100644 --- a/src/libImaging/Storage.c +++ b/src/libImaging/Storage.c @@ -132,7 +132,7 @@ ImagingNewPrologueSubtype(const char *mode, int xsize, int ysize, int size) } else if (strcmp(mode, "BGR;15") == 0) { /* EXPERIMENTAL */ - /* 15-bit true colour */ + /* 15-bit reversed true colour */ im->bands = 1; im->pixelsize = 2; im->linesize = (xsize*2 + 3) & -4; From 51457311ded46e0e5fb9a171ecbd87ac47003c86 Mon Sep 17 00:00:00 2001 From: Andrew Murray <3112309+radarhere@users.noreply.github.com> Date: Fri, 6 Sep 2019 06:10:40 +1000 Subject: [PATCH 3/4] Reference Pillow not PIL [ci skip] Co-Authored-By: Hugo van Kemenade --- docs/handbook/concepts.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/handbook/concepts.rst b/docs/handbook/concepts.rst index a254d11c329..cb6b51e6476 100644 --- a/docs/handbook/concepts.rst +++ b/docs/handbook/concepts.rst @@ -60,7 +60,7 @@ PIL also provides limited support for a few special modes, including: * ``BGR;24`` (24-bit reversed true colour) * ``BGR;32`` (32-bit reversed true colour) -However, PIL doesn’t support user-defined modes; if you need to handle band +However, Pillow doesn’t support user-defined modes; if you need to handle band combinations that are not listed above, use a sequence of Image objects. You can read the mode of an image through the :py:attr:`~PIL.Image.Image.mode` From 5ad5be4a32e26ae455a1d520b6fac0a2cef2a22f Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 6 Sep 2019 06:13:12 +1000 Subject: [PATCH 4/4] Reference Pillow not PIL [ci skip] --- docs/handbook/concepts.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/handbook/concepts.rst b/docs/handbook/concepts.rst index cb6b51e6476..582866345e5 100644 --- a/docs/handbook/concepts.rst +++ b/docs/handbook/concepts.rst @@ -44,7 +44,7 @@ supports the following standard modes: * ``I`` (32-bit signed integer pixels) * ``F`` (32-bit floating point pixels) -PIL also provides limited support for a few special modes, including: +Pillow also provides limited support for a few special modes, including: * ``LA`` (L with alpha) * ``PA`` (P with alpha)