diff --git a/PIL/Image.py b/PIL/Image.py index 66149e320..63ef2cd96 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -625,7 +625,7 @@ class Image: self.mode = mode self.size = size self.im = core.new(mode, size) - if mode in ("L", "P"): + if mode in ("L", "P") and palette: self.putpalette(palette) self.frombytes(data)