Spritesheet generator in Python