pytorch / pytorch/vision

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

Open
#9,151 4 comments 2 reactions 1 assignee View on GitHub

@scotts is already working on this.

Since Aug 28, 2025.

Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.