Skip to content
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Square Fit Image

Powered By Electricity Build With Love

This script allows user to add white color (can be changed via code) to a directory containing images and resize them to square shape, without stretching or diminishing them! (Recursive, not checked)

For example, if I have an image thats 1920x1080 (ie. in landscape), this script will add white borders automatically to top and bottom to make it 1920x1920 (ie. the bigger of the two dimensions). Pretty Neat.


You must have PIL or Pillow installed. To install it using pip, use the code below:

pip install pillow


Run the script and enter the absoulute path of directory that contains the image. If the script finds an image it will be converted and stored in a folder 'converted' relative to input path.


Left image is original and right one is converted!

You can’t perform that action at this time.