New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added rawmode argument to Image.getpalette() #6061
Conversation
ca8e5e1
to
6be8727
Compare
Would it make sense to also allow converting via a |
Just for clarity - you've talking about Bear with me as I try and put this into a coherent thought. I don't think there's an inherit pull for After this PR, If you wanted to convert the data from an ImagePalette to a particular mode, you could im.putpalette(palette)
im.getpalette(rawmode) I would think of ImagePalette as being for the analysis and modification of a palette. I can imagine one wanting to
But are you saying you have a scenario where you would like to skip step 3? So you have a situation where you would like to load an image, modify the palette, take a copy of the palette for external purposes, and no longer use the image with it's modified palette? |
Fair enough - I only suggested
Not sure, I imagine that if there is a need for this the user may simply deep copy the palette. But to be precise, my idea was more along the lines of:
However, sounds like a modified |
Thanks! |
Resolves #6059
At the moment,
getpalette()
only returns the palette in RGB mode. This PR adds arawmode
argument that allows the user to specify the mode that the palette shoud be returned as.I've also allowed the
rawmode
to beNone
, in case the user would like the palette returned without transformation.