Skip to content

Instantly share code, notes, and snippets.

@giginet
Created March 19, 2014 20:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giginet/9650080 to your computer and use it in GitHub Desktop.
Save giginet/9650080 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
#
# cocos2d-x-icon-generator.py
# created by giginet on 2014/02/27
#
import sys
from PIL import Image
SIZES = (
(29, 29),
(40, 40),
(50, 50),
(57, 57),
(58, 58),
(72, 72),
(76, 76),
(80, 80),
(100, 100),
(114, 114),
(120, 120),
(144, 144),
(152, 152)
)
if __name__ == '__main__':
filename = sys.argv[1]
original = Image.open(filename)
for size in SIZES:
resized = original.resize(size, Image.ANTIALIAS)
resized.save("Icon-%d.png" % size[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment