Skip to content

Only deprecate fromarray mode for changing data types #9063

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Jul 3, 2025

Further discussion in #9018 has suggested that some of the functionality in the fromarray() mode argument is still useful.

#9018 (comment)

When this was proposed, there was the one legitimate use case mentioned (P), this is definitely another. Specifying that the uint8 pixels represent YCbCr instead of RGB is the sort of cast that is safe and useful for importing -- it's essentially the same operation as specifying a colorspace -- rather than specifying a bit layout which is what trips people up.

This PR restores it for changing

  • L -> P
  • LA -> La, PA
  • RGB -> YCbCr, LAB, HSV
  • RGBA -> RGBa, RGBX, CMYK

@djhoese
Copy link

djhoese commented Jul 25, 2025

Any idea when this might be merged? And any idea what version it might be released in?

The previous deprecation has been causing a lot of warnings in my projects which I think this PR should fix. Thanks for allowing these cases.

@radarhere
Copy link
Member Author

Pillow 12.0.0 is scheduled for October 15. I expect that it will be merged by then.

@radarhere radarhere added this to the 12.0.0 milestone Jul 26, 2025
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