Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Image
- import os.path
- fpx = 64
- # max +/- Y coordinate
- fy = 40
- # max +/- X coordinate
- fx = 90
- # ~max number of maps.
- mn = 60
- hasmaps = False
- for n in range(0, mn):
- hasmaps = False
- new_im = Image.new('RGB', (fpx*fx*2, fpx*fy*2))
- for y in range(-fy, fy):
- for x in range(-fx, fx):
- # Look for files one directory up.
- fname = "../%d_%d_%d.bmp"%(n, x, y)
- if os.path.isfile(fname):
- hasmaps = True
- im = Image.open(fname)
- new_im.paste(im, ((x+fx)*fpx, (y+fy)*fpx))
- if hasmaps:
- new_im.save("map_%d.bmp"%n, 'BMP')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement