Skip to content

Instantly share code, notes, and snippets.

@spiiin
Created November 4, 2013 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spiiin/7305425 to your computer and use it in GitHub Desktop.
Save spiiin/7305425 to your computer and use it in GitHub Desktop.
import Image
def cutBlock(pp):
im = Image.open(pp)
imCut = im.crop((127,52,127+32,52+32)) #load one screenshot to any graphic editor and calc this coords
imCut.save(pp.replace(".bmp",".png"))
for x in xrange(256):
cutBlock(r"scr\%04d.bmp"%x)
imBig = Image.new("RGB", (32*256,32))
for x in xrange(256):
im = Image.open(r"scr\%04d.png"%x)
imBig.paste(im, (32*x,0,32*x+32,32))
#if need, resize to correspond size
imBig.save(r"scr\outStrip.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment