Python provides a lot of useful tools and libraries to handle images.
If you want to resize an image, for example if you want to create a thumbnail, you can use the following few lines of python code:
The program is really simple and self explanatory, I want to add that you can use a different filter to apply when resizing. You can choose a filter in the following set:
If you want you can change this program to handle the command line arguments, in this way you can pass, to the program, a variable number of input files and then it will apply the resize to all the files.
Next week I’ll show you how to implement this feature.