Write function on python which resize image to 70% of background's width with save…
- User
Write function on python which resize image to 70% of background's width with save original proportions
- Assistant
To resize an image to 70% of a background's width while maintaining the original proportions of the image, you can use the Python Imaging Library (PIL), which is a part of the
Pillowlibrary. If you haven't installed Pillow yet, you can do so by runningpip install Pillowin your terminal or command prompt. - User
I got error that ANTIALIAS is not known member of PIL.Image
- Assistant
As of Pillow version 7.0.0 (January 2, 2020), the
ANTIALIASfilter has been renamed toPIL.Image.Resampling.LANCZOS. This change was made to clarify the resampling method being used and to bring more consistency to the naming of resampling filters in Pillow.Here's the updated function using the latest terminology:
python