import Image, re
xB=512
yB=384
xs=320
ys=200
for i in range(1,360):
    f1name='eclipser_tilt_base%(#)03d.bmp' % {  "#": i}
    f2name='eclipser_tilt_inset%(#)03d.bmp' % {  "#": i}
    f3name='eclipser_tilt_out%(#)03d.bmp' % {  "#": i}
    im1 = Image.open(f1name)
    im2 = Image.open(f2name)
    imout = Image.new('RGB', (xB,yB))
    box = (0, 0, xB, yB)
    region = im1.crop(box)
    imout.paste(region, box)
    box = (0, 10, xs, ys)
    region = im2.crop(box)
    box=(xB-xs,yB-ys+10,xB,yB)
    imout.paste(region, box)
    imout.save(f3name,"BMP")
