Created
March 19, 2019 15:09
-
-
Save JSeam2/4688feb9480edb9182ccde3fe33fa9de to your computer and use it in GitHub Desktop.
Simple script to crop all files in the current folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PIL | |
from PIL import Image | |
import os | |
for x in os.listdir("./"): | |
try: | |
img = Image.open(x) | |
w, h = img.size | |
new_img = img.crop((100, 100, w-200, h-30)) | |
new_img.save(x) | |
except: | |
continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment