Skip to content

Instantly share code, notes, and snippets.

@NWPlayer123
Created August 31, 2017 10:30
Show Gist options
  • Save NWPlayer123/1008a093b31d0cd6416411689e24a621 to your computer and use it in GitHub Desktop.
Save NWPlayer123/1008a093b31d0cd6416411689e24a621 to your computer and use it in GitHub Desktop.
Sonic Mania Tile Separator
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