Download presentation
Presentation is loading. Please wait.
Published byRalph Norman Modified over 9 years ago
1
Movie of picture negatives # Pseudo Code def movieNeg(directory, pic): for each column of ‘pic’ across the entire width for each pixel from top of the column to bottom convert a pixel to its negative in ‘pic’ save ‘pic’ into frameXXX.jpg # Python Code def movieNeg(directory, pic):
2
LAB Complete the movie making that captures column-wise complementing of a picture, if you were not able to finish on Wed. Write a function to create animation frames with increasingly more sunset effects. Email only your python program (not a screen shot) to kim@cs.uml.edu kim@cs.uml.edu
3
Create a sunset animation makeSunset(pic, r) function creates a sunset effect on a single picture called ‘pic’ by reducing green and blue in every pixel by r percent, where the value of r is specified when the function is called. Its Python code is in the next slide. Write a function that repeatedly calls makeSunset(pic,r), each time with smaller fractional value. After sunset effect is created, the picture is saved into ssXX.jpg with a 2-digit sequence number. Put together a series of pictures into an animation
4
Sunset effect on one picture def makeSunset(picture, r): for x in range(1, getWidth(picture)): for y in range(1, getHeight(picture)): p = getPixel(picture, x, y) value=getBlue(p) setBlue(p,value*r) value=getGreen(p) setGreen(p,value*r) return picture
5
Slow Sunset in animation We know how to make one picture with a sunset effect Repeatedly apply sunset effect on the same picture def slowsunset(pic): rate = 1.0 Repeat for N times create an empty picture with the same dimension as ‘pic’ Reduce the value of ‘rate’ (say, by 1/N) newPic = makeSunset(pic, rate) save newPic as ssXX.jpg
6
Final Project Due: 5/7 (Th) 3:00 pm Presentation of the final project: 2-min presentation on 4/17 (F) on project topic 10-min each on 5/7 3:00-6:00pm
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.