I’ve just uploaded my first project for public consumption.
I recently was faced with a completely full hard drive on one of my PCs. I had a large collection of images that I needed to keep for future reference, but many of them were saved in their original high quality resolution and format. It wasn’t necessary for me to keep the original high quality files, and going through 1000s of images manually to resize was out of the question.
I was unable to find a program to quickly and automatically resize all the images in a given directory, so I wrote my own. This is a simple image resizing program to automate resizing of PNG and JPG/JPEG images in a given directory. Simply copy the executable or python script into the target directory and run it. The images will be resized, overwriting the current images with a smaller version.
This simple python program uses pillow and pyautogui to:
- Ask the user to enter a resize percentage (0 to 100).
- Iterates through all PNG and JPEG objects in the root directory and resizes them based on the input from step 1.
- Skips any image that is already under 1MB in size.
- Reports to the user how many images were resized.