Collection of useful Python scripts
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Collection of useful Python scripts

1. Image Resizer

I created the script to resize thousands images in a single-run Python command in Linux (Ubuntu). This will also work in Windows i guess. It can resize thousands of images ( I run it before for > 50K images)

Suppose we have images stored in Folder structures like this :


---- Tigers





---- Cats





---- n






ans so on.

Run the script with this steps :

  1. Open your terminal, and type

  2. python {img source folder} {the size you want the image to be} {destination folder}

    example :

     python /home/ubuntu/images/ 128 /home/ubuntu/new_images
  3. Drink your coffee and watch the terminal running the process


  1. Install PIL image if you dont have one
  2. ANTIALIAS and quality=90 is to prevent the image from downgrading quality
  3. Images will be converted to .jpg extension ( its up to you, you can change it your way)

Tutorial about this is here : or