#!/usr/bin/env python3
import numpy as np
from tkinter import *
cw=800
ch=600
delay=50
root = Tk()      
canvas = Canvas(root,width=cw,height=ch,background='#ffffff')      
canvas.pack()
owl=[]
img = PhotoImage(file="owl.png")
BigOwl=img.zoom(3)
owl.append(BigOwl)
i=30
while i>14:
  temp=BigOwl.zoom(i)
  owl.append(temp.subsample(30))
  print(i/30)
  i-=1
i=12
while i>7:
  temp=BigOwl.zoom(i)
  owl.append(temp.subsample(24))
  print(i/24)
  i-=1
i=3
while i<11:
  owl.append(BigOwl.subsample(i))
  i+=1
RevOwl=owl[:]
RevOwl.reverse()
i=0
while i<10:
  RevOwl.append(BigOwl)
  i+=1
owl=RevOwl+owl
n=len(owl)
i=0
while True:
  canvas.delete(ALL)
  canvas.create_image(300,300,anchor=CENTER,image=owl[i%n])
  canvas.update()
  i+=1
  canvas.after(delay)






