Created
August 31, 2017 10:30
-
-
Save NWPlayer123/1008a093b31d0cd6416411689e24a621 to your computer and use it in GitHub Desktop.
Sonic Mania Tile Separator
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 | |
from os import mkdir | |
from os.path import exists | |
if not exists("tiles"): | |
mkdir("tiles") | |
inf = Image.open("16x16Tiles.gif") | |
pos = 0 | |
for i in range(1024): | |
out = Image.new("RGB", (128, 128)) | |
tile = inf.crop((0, pos, 16, pos + 16)) | |
tile = tile.resize((128, 128)) | |
out.paste(tile) | |
out.save("tiles/%04d.png" % i) | |
pos += 16 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment