Skip to content

Instantly share code, notes, and snippets.

View sohrabhamza's full-sized avatar

Sohrab Hamza sohrabhamza

View GitHub Profile
@sohrabhamza
sohrabhamza / squareCrop.py
Last active November 2, 2022 14:26
Add black bars to the top or bottom of an image to make them all square (for social media like Instagram)
from PIL import Image
import glob
import os
os.mkdir(("Output"))
i = 1
for myIm in glob.glob("*.jpg"):
im = Image.open(myIm)
negatorX = 1
negatorY = 1