Skip to content

Image.convert broken for P to RGB? #6390

Answered by radarhere
TheRealQuantam asked this question in Q&A
Discussion options

You must be logged in to vote

Testing your code, I think all of your problems can be solved by replacing

img.palette = img_pal

with

img.putpalette(img_pal)

See https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.putpalette for documentation.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@TheRealQuantam
Comment options

@TheRealQuantam
Comment options

@radarhere
Comment options

@TheRealQuantam
Comment options

Answer selected by radarhere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants