Skip to content

Fix Pillow resampling change in rgb_display_pillow_animated_gif.py #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/rgb_display_pillow_animated_gif.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
not support PIL/pillow (python imaging library)!

Author(s): Melissa LeBlanc-Williams for Adafruit Industries
Mike Mallett <mike@nerdcore.net>
"""
import os
import time
Expand Down Expand Up @@ -122,7 +123,7 @@ def preload(self):
frame_object.image = ImageOps.pad( # pylint: disable=no-member
image.convert("RGB"),
(self._width, self._height),
method=Image.NEAREST,
method=Image.Resampling.NEAREST,
color=(0, 0, 0),
centering=(0.5, 0.5),
)
Expand Down
2 changes: 1 addition & 1 deletion examples/rgb_display_pillow_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
else:
scaled_width = width
scaled_height = image.height * width // image.width
image = image.resize((scaled_width, scaled_height), Image.BICUBIC)
image = image.resize((scaled_width, scaled_height), Image.Resampling.BICUBIC)

# Crop and center the image
x = scaled_width // 2 - width // 2
Expand Down