Skip to content

Instantly share code, notes, and snippets.

@chrisamow
chrisamow / README.md
Last active April 25, 2021 10:26 — forked from will-hart/README.md
Stitch together tilemaps into a single image

Why?

This is a simple Python / PIL utility for taking a series of images in a tile map set and stitching them together into a single image. This is being used to convert these http://forums.bistudio.com/showthread.php?178671-Tiled-maps-Google-maps-compatible-(WIP) for www.anvilproject.com.

How?

  1. Drop the stitcher.py file into the root directory of your tile map set, where all the numbered folders are
  2. Edit two lines in the file, these are commented - one for the number of folders and one for the number of images in each folder
def flatten(intlist):
"""flatten an arbitrarily nested list of integers
e.g.
flatten([[1,2,[3]],4]) returns [1,2,3,4]
"""
retlist = [ ]
for n in intlist:
if type(n) == list:
retlist.extend(flatten(n))
else: