From 06301c9eba3904acf8a9b7b707caa71ba7b6a0d3 Mon Sep 17 00:00:00 2001 From: David Schmidt Date: Tue, 12 Nov 2013 14:41:35 +0100 Subject: [PATCH] don't create a new palette on Image._new if one already exists (i.e. after im.copy()) --- PIL/Image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PIL/Image.py b/PIL/Image.py index e1d88fe59..ec5ff548d 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -475,7 +475,7 @@ class Image: new.mode = im.mode new.size = im.size new.palette = self.palette - if im.mode == "P": + if im.mode == "P" and not new.palette: from PIL import ImagePalette new.palette = ImagePalette.ImagePalette() try: