Skip to content

Conversation

radarhere
Copy link
Member

As with GifImagePlugin

self.pyaccess = None
if "transparency" in self.info:
self.im.putpalettealpha(self.info["transparency"], 0)
self.im = self.im.convert("RGBA", Image.Dither.FLOYDSTEINBERG)
self.mode = "RGBA"
del self.info["transparency"]
else:
self.mode = "RGB"
self.im = self.im.convert("RGB", Image.Dither.FLOYDSTEINBERG)

and PngImagePlugin
self.im = self._prev_im
if self.pyaccess:
self.pyaccess = None

after replacing self.im, self.pyaccess should be cleared.

@hugovk hugovk merged commit 6fc0456 into python-pillow:main Dec 23, 2022
@radarhere radarhere deleted the pyaccess branch December 23, 2022 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants