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!
This commit is contained in:
Hin-Tak Leung 2017-05-10 04:24:01 +01:00 committed by wiredfool
parent a2cb304f62
commit 74da5878c5

View File

@ -69,7 +69,7 @@ class Viewer(object):
# FIXME: auto-contrast if max() > 255? # FIXME: auto-contrast if max() > 255?
else: else:
base = Image.getmodebase(image.mode) 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) image = image.convert(base)
return self.show_image(image, **options) return self.show_image(image, **options)