Removed unnecessary palette copy

This commit is contained in:
Andrew Murray 2022-09-19 12:41:20 +10:00
parent d88200e0d0
commit c0aaf54816

View File

@ -291,9 +291,8 @@ def pad(image, size, method=Image.Resampling.BICUBIC, color=None, centering=(0.5
out = resized
else:
out = Image.new(image.mode, size, color)
palette = image.palette.copy()
if palette:
out.putpalette(palette)
if resized.palette:
out.putpalette(resized.palette)
if resized.width != size[0]:
x = int((size[0] - resized.width) * max(0, min(centering[0], 1)))
out.paste(resized, (x, 0))