CSC108H1 Lecture : Notes

76 views8 pages
29 Apr 2011
School
Course
Professor
yifanyang and 39659 others unlocked
CSC108H1 Full Course Notes
21
CSC108H1 Full Course Notes
Verified Note
21 documents

Document Summary

>>> # python also has functions, like in math. >>> # this function asks the user to choose a file. >>> # i can"t do anything with that file unless i remember it somewhere. >>> # fortunately, python has variables (kind of like in math). >>> # so i can use a variable to remember the filename the user chooses. >>> # now i can ask python to read the image stored in the file of that. >>> # name, and load it into memory. >>> # and now i can ask it to show the picture on the screen. >>> media. show(pic) import media if __name__ == __main__: filename = media. choose_file() pic = media. load_picture(filename) media. show(pic) filename = media. choose_file() pic = media. load_picture(filename) media. show(pic) blue = media. get_blue(pixel) new_blue = int(blue * 0. 7) media. set_blue (pixel, new_blue) #for sunset do the same to the green pixels. www. notesolution. com green = media. get_green(pixel) new_green = int(green * 0. 7) media. set_green (pixel, new_green) media. show(pic)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions