What is the difference between Image.resize and Image.thumbnail in Pillow-Python

Image.resize resizes to the dimensions you specify:

Image.resize([256,512],PIL.Image.ANTIALIAS) # resizes to 256x512 exactly

Image.thumbnail resizes to the largest size that (a) preserves the aspect ratio, (b) does not exceed the original image, and (c) does not exceed the size specified in the arguments of thumbnail.

Image.thumbnail([256, 512],PIL.Image.ANTIALIAS) # resizes 512x512 to 256x256

Furthermore, calling thumbnail resizes it in place, whereas resize returns the resized image.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)