import sys
import Image

im = Image.open(sys.argv[1]).convert("RGBA")

nf = 4
(w,h) = im.size
frames = Image.new(im.mode, (w,h*nf))
frames.paste(im, (0,0))
for i in range(1, nf):
    frames.paste(im.rotate(i*90/nf, Image.LINEAR) , (0,h*i))
frames.save("result.png")
