Created
October 3, 2020 14:33
-
-
Save raster/abc5368885c8d9bda67be3d9a615b953 to your computer and use it in GitHub Desktop.
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
#!/usr/local/bin/python3 | |
# | |
# Pete Prodoehl <pete@2xlnetworks.com> | |
# | |
# Resizes Game Boy Camera photos to 1280x1152 | |
# | |
from PIL import Image | |
import glob | |
import getopt | |
import sys | |
import os | |
# read command line arguments first | |
fullCmdArguments = sys.argv | |
# then read further arguments | |
argumentList = fullCmdArguments[1:] | |
# loop through files, resizing each one | |
for infile in argumentList: | |
file, ext = os.path.splitext(infile) | |
img = Image.open(infile) | |
newimg = img.resize((1280, 1152)) | |
newimg.convert('RGB').save(file + "-1280.png","PNG",Optimize=True) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment