How to resize images – python script .

Sometimes it is necessary to resize the images.
The PIL module is used for image processing.
The glob module takes a wildcard and returns the full path of all files and directories matching the wildcard.
Here are two scripts that I made.
The first is a simple example using a resize after some dimensions.
In this case, we used size 300×300.

In the second case, I tried to do a resize with proportion preservation.

In both cases, we use a renaming of files by adding the name of thumb_.
Source of the tutorial “How to resize images”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.