colorthief is unmaintained and will break with Pillow 14
Maintainers usually reply within 1 day
@anshuman83-40 is already working on this.
Since Oct 29, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with zimscraperlib.image.probing.get_colors and tests/image/test_image.py::test_colors_*; the issue identifies the deprecated Image.Image.getdata() call in the pinned colorthief dependency. Compare the proposed vendoring, maintained replacement, and Pillow-only approaches, then check the existing color tests against representative images. Done means the Pillow 14 blocker is resolved and the expected color behavior is confirmed.
Written by the indexing model from the issue text.
Description
zimscraperlib.image.probing.get_colors relies on colorthief (pinned to 0.2.1), which calls Image.Image.getdata(). Pillow 13 deprecates this method and will remove it in Pillow 14 (2027-10-15):
colorthief.py:65: DeprecationWarning: Image.Image.getdata is deprecated and will be removed in Pillow 14 (2027-10-15). Use get_flattened_data instead.
pixels = image.getdata()
This is currently the only warning raised by our test suite (tests/image/test_image.py::test_colors_*).
Our pillow<14.0 upper bound protects us for now, but it means we will be stuck on Pillow 13 until this is solved.
colorthief is unmaintained
- last release (0.2.1) is from February 2017, last commit from 2019
- a fengsp/color-thief-py#36 issue about this exact deprecation got no answer from the maintainer
- an upstream fix and release is hence very unlikely
Options
- Vendor colorthief into zimscraperlib (BSD-licensed, ~420 lines including docstrings, pure Python, only depends on Pillow), replacing
getdata()byget_flattened_data().- pros: no new dependency, exact same colors as today (no change for scrapers), we can type it properly and drop the many
pyright: ignoreinget_colors - cons: we own the maintenance of the code (but the MMCQ algorithm is stable, only Pillow API evolutions are expected to matter)
- pros: no new dependency, exact same colors as today (no change for scrapers), we can type it properly and drop the many
- Switch to
modern_colorthief, a Rust re-implementation created precisely because of this deprecation (MIT, actively maintained, last release 0.3.0 in June 2026).- pros: maintained, fast, no Python dependency
- cons: single maintainer and low adoption (supply-chain risk), compiled wheels needed for all platforms our scrapers run on (amd64/arm64, glibc/musl), results are slightly different from colorthief (see their DIFFERENCES.md) so our expected colors in tests (and scrapers output) would change slightly; to be assessed on our test images
- Reimplement with Pillow only (
Image.quantize(..., method=Quantize.MEDIANCUT)+getcolors()).- pros: no dependency, very little code
- cons: different algorithm, so different colors; colorthief also ignores white and transparent pixels, which we would need to replicate
Other packages considered and discarded: fast-colorthief (needs numpy, no release since 2023, no wheels for recent Python), Pylette (way too heavy: OpenCV, scikit-learn, ...), extcolors and haishoku (unmaintained since 2019/2020).
Proposal
Option 1 seems the most conservative one: it removes an unmaintained dependency without changing any output nor adding a new third-party dependency. Option 2 is worth considering if we prefer not to own this code.
- Dominant language
- Python
- Stars
- 33
- Forks
- 34
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 24
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openzim/python-scraperlib
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
openzim/python-scraperlib#414 ·
Maintainers usually reply within 1 day
-
HtmlRewriter: title is cut at the first `&` (entity or bare ampersand)Possibly taken @rajanpanth claimed this 12 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
openzim/python-scraperlib#401 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
[next major] Remove deprecated 'convert' parameter for optimize_image function inside optimization.pyPossibly taken @Sriram-Nambiar claimed this 40 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
openzim/python-scraperlib#292 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
compute_tags keeps empty tagsPossibly taken @ahmershahdev claimed this 1 day ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 32/100
openzim/python-scraperlib#412 · 1 comment ·
Maintainers usually reply within 1 day
-
Release 5.7.0Possibly taken @benoit74 claimed this 4 days ago. Open
openzim/python-scraperlib#411 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in openzim/python-scraperlib
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
vllm-project/vllm#69791 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
BCStudentSoftwareDevTeam/cas#481 ·
Maintainers usually reply within 7 days
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day