From c9ba107c2ca20f00b0c8daf524321b7efba49dc5 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 2 Oct 2023 19:08:17 +1100 Subject: [PATCH] Palette is unneeded as RGB to P conversion will not occur --- src/PIL/PngImagePlugin.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/PIL/PngImagePlugin.py b/src/PIL/PngImagePlugin.py index aa5af02b441..8824cc08b12 100644 --- a/src/PIL/PngImagePlugin.py +++ b/src/PIL/PngImagePlugin.py @@ -1104,10 +1104,7 @@ def _write_multiple_frames(im, fp, chunk, rawmode, default_image, append_images) if im_frame.mode == rawmode: im_frame = im_frame.copy() else: - if rawmode == "P": - im_frame = im_frame.convert(rawmode, palette=im.palette) - else: - im_frame = im_frame.convert(rawmode) + im_frame = im_frame.convert(rawmode) encoderinfo = im.encoderinfo.copy() if isinstance(duration, (list, tuple)): encoderinfo["duration"] = duration[frame_count]