Calling
image = Image.open(data) image.thumbnail((36,36), Image.NEAREST)
will maintain the aspect ratio. But I need to end up displaying th
Why not simply use the resize method ?
from PIL import Image image = Image.open('/path/to/img.png') image = image.resize((36,36), Image.ANTIALIAS)
See recommendations for image resizing in this release note: https://pillow.readthedocs.io/en/stable/releasenotes/5.3.0.html