Skip to content

Instantly share code, notes, and snippets.

@duhaime
Created March 25, 2017 15:22
Show Gist options
  • Select an option

  • Save duhaime/7005f194783bee3496215417c72ad7c9 to your computer and use it in GitHub Desktop.

Select an option

Save duhaime/7005f194783bee3496215417c72ad7c9 to your computer and use it in GitHub Desktop.
Resize monochromatic splash page to required ios sizes
import os, sys
print 'processing', sys.argv[1]
sizes = [
(1242, 2208),
(750, 1134),
(2208, 1242),
(640, 960),
(640, 1136),
(708, 1024),
(1536, 2048),
(1024, 768),
(2048, 1536),
(320, 480),
(640, 960),
(640, 1136)
]
filename = sys.argv[1]
outdir = filename.split('.')[0] + '-resized'
if not os.path.exists(outdir):
os.makedirs(outdir)
for i in sizes:
file_root = os.path.basename(filename)
dims = str(i[0]) + 'x' + str(i[1])
outfile = outdir + '/' + file_root.split('.')[0] + '-' + dims + '.png'
os.system('convert -resize ' + dims + '! ' + file_root + ' ' + outfile)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment