vision icon indicating copy to clipboard operation
vision copied to clipboard

Follow-up on Pillow's mode argument in Image.fromarray()

Open scotts opened this issue 5 months ago • 2 comments

PR #9150 fixed Issue #9135. The issue is that Pillow deprecated the mode parameter in Image.fromarray(): https://pillow.readthedocs.io/en/stable/releasenotes/11.3.0.html#image-fromarray-mode-parameter. Also see the Pillow PR that implements the change for more discussion: https://github.com/python-pillow/Pillow/pull/9018

However, we depend on the old behavior. PR #9150 implements an ugly hack to mitigate the removal of the old behavior. Pillow PR https://github.com/python-pillow/Pillow/pull/9063 partially restores the mode parameter. When it is part of a release, we should evaluate if we can go back to using the mode parameter in Image.fromarray() and avoid our ugly hack.

scotts avatar Jul 16 '25 11:07 scotts

According to https://github.com/python-pillow/Pillow/pull/9063#issuecomment-3121046271, the fix should be merged into the 12.0.0 Pillow release on October 15. We should check after then.

scotts avatar Aug 30 '25 01:08 scotts

Pillow 12.0.0 was released and includes the referenced PR

h-vetinari avatar Nov 27 '25 06:11 h-vetinari