Skip to content

fix: replace deprecated PIL getdata() with get_flattened_data()#107

Open
ecerulm wants to merge 1 commit into
lnqs:mainfrom
ecerulm:pillow-getdata-deprecated
Open

fix: replace deprecated PIL getdata() with get_flattened_data()#107
ecerulm wants to merge 1 commit into
lnqs:mainfrom
ecerulm:pillow-getdata-deprecated

Conversation

@ecerulm
Copy link
Copy Markdown

@ecerulm ecerulm commented May 16, 2026

Summary

  • Pillow has deprecated Image.getdata(). This PR switches textual_image/_pixeldata.py to use the new Image.get_flattened_data() method, which is identical except that it returns a tuple of pixel values instead of an internal Pillow data type.
  • The downstream consumer here only iterates the returned data, so the change is transparent.

Test plan

  • pytest — 91 passed, 1 skipped. (One pre-existing snapshot failure in tests/renderable/test_sixel.py::test_render is unrelated; it reproduces on main and is a Pillow palette-ordering drift.)

Closes #106

Pillow has deprecated `Image.getdata()`. Use the new
`Image.get_flattened_data()` method, which returns the pixel values as a
tuple instead of an internal Pillow data type but is otherwise
identical.
@ecerulm ecerulm marked this pull request as ready for review May 16, 2026 18:30
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.

Pillow 12 deprecation: Image.getdata() in _pixeldata.py:141 (removal in Pillow 14)

1 participant