Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@raster
Created October 3, 2020 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raster/abc5368885c8d9bda67be3d9a615b953 to your computer and use it in GitHub Desktop.
Save raster/abc5368885c8d9bda67be3d9a615b953 to your computer and use it in GitHub Desktop.
#!/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