Skip to content

Conversation

@radarhere
Copy link
Member

This is part of #8362 - I'm hoping to break down that PR into easier-to-review chunks.

Image's palette may be None

>>> from PIL import Image
>>> im = Image.new("RGB", (1, 1))
>>> im.palette is None
True

So before using it, let's assert that it isn't None.

@hugovk hugovk merged commit 3a18e55 into python-pillow:main Jun 27, 2025
54 checks passed
@radarhere radarhere deleted the palette branch June 27, 2025 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants