-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
BugAny unexpected behavior, until confirmed feature.Any unexpected behavior, until confirmed feature.
Description
Running this script (which converts a paletted image to RGB, resizes it with antialiasing enabled, and converts it back to paletted) on the provided in.gif results in an image with a broken palette.
From git bisect, the offending commit is 06301c9 - this suggests that it's holding on to the image's original palette, which is no longer valid after the RGB data is modified by the resize operation. (The bug is avoided if you save and reopen the image while it is in RGB mode, immediately before or after the image.resize line.)
from PIL import Image
image = Image.open('in.gif')
image = image.convert('RGB')
image = image.resize((200, 150), Image.ANTIALIAS)
image = image.convert('P', palette=Image.ADAPTIVE, colors=256)
image.save('out.png')
Metadata
Metadata
Assignees
Labels
BugAny unexpected behavior, until confirmed feature.Any unexpected behavior, until confirmed feature.


