Created
July 28, 2022 20:10
-
-
Save keewon/4c21023c922c8029c62886d418790d47 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
from PIL import Image | |
original_11 = "1024.png" | |
original_43 = "1024x768.png" | |
im = Image.open(original_11) | |
variants_11 = [ | |
58, | |
87, | |
] | |
variants = [ | |
(120, 90), | |
(180, 135), | |
(134, 100), | |
(148, 110), | |
(54, 40), | |
(81, 60), | |
(64, 48), | |
(96, 72), | |
] | |
for v in variants_11: | |
im = Image.open(original_11) | |
n = im.resize((v, v), Image.ANTIALIAS) | |
n.save("{}x{}.png".format(v, v)) | |
for (x,y) in variants: | |
im = Image.open(original_43) | |
n = im.resize((x, y), Image.ANTIALIAS) | |
n.save("{}x{}.png".format(x, y)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment