Created
February 23, 2016 21:06
-
-
Save MrPowerGamerBR/9350f53f890e7604eb85 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| import os | |
| im = Image.open("Voto_Carinha.png") | |
| size = (3264,1216) # size of the image to create | |
| im2 = Image.new('RGB', size) # create the image | |
| x = 0; | |
| y = 0; | |
| path = 'C:\Users\User\Documents\Python\skins' | |
| for filename in os.listdir(path): | |
| if (filename.endswith(".png")): | |
| if (x > 3264): | |
| x = 0; | |
| y = y + 32; | |
| if (y > 1216): | |
| print "high" | |
| break; | |
| # do your stuff | |
| im = Image.open(path + "\\" + filename) | |
| im = im.resize((32, 32)) | |
| box = (0, 0, 32, 32) | |
| loc = (0, 0, x, y) | |
| region = im.crop(box) | |
| im2.paste(region, (x, y)) | |
| x = x + 32; | |
| print x; | |
| print y; | |
| print filename | |
| im2.save("skins.png"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment