![]() ![]() |
| |||||||||
| Hotspots: Slides and Code TA Corner Comments? Announcements FAQ Static Webspace | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Not really. However, a picture that is very large may take a while to loop through. Greg Leo |
| Check out the FAQ. Greg Leo |
| none of the above :) Your code should work on any picture...it takes a picture as an input! This makes codes more universal so you can use them multiple times (you might can use this code on a later homework...). Your TA will grade using a picture of his/her choice and your code should work for anything the TA picks. So, you do not need to put pickAFile() in your program...you assume that when we ask for a picture input, that whoever is running the code will make a picture before passing it into the function. Amanda Bennett |
| check out the FAQ. Amanda Bennett |
| You can use show(picture) to make it pop up again or repaint(picture) to make it refresh. |
Find a JPEG on your computer or get one from the internet and test your program with it.
You should see the posterized picture come up if you did it correctly. |
Try: if red > 50 and red <= 128: You don't need the parenthesis.Greg Leo |
| Do you remember the difference between = and == from class? Kelly Lyons |
| Are your if's indented so that they are included in the for loop? |
| <= and >= are the correct operators for less than or equal to and greater than or equal to. The whole == thing is to make a distinction from the store value operator, =. |
writePictureTo takes in the picture variable and a path on your hard drive. So suppose you have a variable pic that you called your posterize function on...
|
| You can use any code you want as long as you write it and it works :) Amanda Bennett |
Did you load your function first? Make sure you do that! also, where did you get pic from? when you run posterize(picture) you may want to set a variable equal to it. try posterize(picture) pic = picture writePictureTo(pic, r"C:\Documents and Settings\Andrew\Desktop\AndrewBryant.jpg")Amanda Bennett |