From dc542cb0e60bdc82dd126c3ef46a18a19dd8f86c Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Wed, 10 May 2017 04:24:01 +0100 Subject: [PATCH] Do not down-convert if image is RGBA when showing. The down-convert code would convert all RGB-based modes (P RGB RGBX RGBA CMYK YCbCr LAB HSV) to RGB; but png can handle it! --- PIL/ImageShow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PIL/ImageShow.py b/PIL/ImageShow.py index d03dc4627..23e0126a7 100644 --- a/PIL/ImageShow.py +++ b/PIL/ImageShow.py @@ -69,7 +69,7 @@ class Viewer(object): # FIXME: auto-contrast if max() > 255? else: base = Image.getmodebase(image.mode) - if base != image.mode and image.mode != "1": + if base != image.mode and image.mode != "1" and image.mode != "RGBA": image = image.convert(base) return self.show_image(image, **options)