Created
December 25, 2014 20:45
-
-
Save enlavin/fb26a19bf0c92848d55d to your computer and use it in GitHub Desktop.
Quick and dirty Minecraft 1.7 -> 1.8 skin converter
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
#!/usr/bin/env python | |
# Quick and dirty Minecraft 1.7 -> 1.8 skin converter | |
# skinconvert.py oldskin.png newskin.png | |
from __future__ import print_function | |
import os | |
import sys | |
from PIL import Image | |
if len(sys.argv) != 3: | |
print('usage: skinconvert.py oldskin newskin') | |
print('Converts Minecraft 1.7 skins to new 1.8 format.') | |
sys.exit(1) | |
orig = Image.open(sys.argv[1]) | |
new = Image.new('RGBA', (64, 64)) | |
new.paste(orig, (0, 0, 64, 32)) | |
rl = orig.crop((0, 16, 16, 32)) | |
new.paste(rl, (16, 48, 32, 64)) | |
ra = orig.crop((40, 16, 56, 32)) | |
new.paste(ra, (32, 48, 48, 64)) | |
try: | |
os.stat(sys.argv[2]) | |
print('Output file already exists') | |
except OSError: | |
new.save(sys.argv[2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment