Tickertape def tickertape(directory,string): for each frame to generate create an new canvas write the string on canvas slightly left of the previous frame get char string of frame number frame number starting with ‘0’ save the canvas
Tickertape def tickertape(directory,string): for num in range(1,100): #99 frames canvas = makeEmptyPicture(300,100) #Start at right, and move left addText(canvas,300-(num*10),50,string) # Now, write out the frame # Handle frame number numStr=str(num) if num < 10: seq = ‘0’+numStr else: seq = numStr writePictureTo(canvas,directory+ "/frame’+seq+".jpg") def tickertape(directory,string): for each frame to generate create an new canvas write the string on canvas slightly left of the previous frame get char string of frame number frame number starting with ‘0’ save the canvas
Making a tickertape - 2 def getCharNum(thisNum): if thisNum <10: return ‘0'+str(thisNum) else: return str(thisNum) def tickertape(directory,string): for num in range(1,100): #99 frames canvas = makeEmptyPicture(300,100) #Start at right, and move left addText(canvas,300-(num*10),50,string) writePictureTo(canvas,directory+"/frame0"+getCharNum(num)+".jpg")
LAB You want to capture the process of converting a picture to its negative by saving the picture each time a new column is converted into a sequence of picture frames Each time a new column of pixels is converted to negatives, you want to save it into a picture frame, numbered ‘framexxx.jpg’ where ‘xxx’ is a sequential number only your python program (not a screen shot) to
Movie of picture negatives def getCharNum(n): if n <10: return ’00’+str(n) elif n <100: return ‘0’+str(n) else return str(n) # Pseudo Code def movieNeg(directory, pic): for each column of the picture for the entire width for each pixel from top of the column to bottom convert a pixel to its negative save the picture into frameXXX.jpg
Movie of picture negatives def getCharNum(n): if n <10: return ’00’+str(n) elif n <100: return ‘0’+str(n) else return str(n) # Pseudo Code def movieNeg(directory, pic): for each column of the picture across the entire width for each pixel from top of the column to bottom convert a pixel to its negative save the picture into frameXXX.jpg
Movie of picture negatives # Pseudo Code def movieNeg(directory, pic): for each column of the picture across the entire width for each pixel from top of the column to bottom convert a pixel to its negative save the picture into frameXXX.jpg # Python Code def movieNeg(directory, pic):