![]() ![]() |
| |||||||||
| Hotspots: Slides and Code TA Corner Comments? Announcements FAQ Static Webspace | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Remember that the green and red variables here refer to the red and green components of the color of a single pixel, so interpretation (a) is the only one that makes sense. In fact, I'm not sure what you mean by (b). Colin Potts BTW, if you use the box at the bottom of this page instead of editing the page itself, your question will always appear last and be answered by TAs. |
| Once again, read other students questions and their answers before you ask a question. And to answer your question again... read the FAQ page. Liz Helms |
| Pretty much, yes. A few syntactical differences, though. -Blake O'Hare |
| When you turn your function in it should not include show() or writePictureTo(). However when you are writing your code feel free to use show to test your program and see the results. Also you need to use writePictureTo to recieve the extra credit. Just make sure to take out those lines before you turn your function in -Albert d'Heurle |
| No! (to the first question) Of course! (to the second) -Blake O'Hare |
| Yes. -Blake O'Hare |
| Read the FAQ. -Blake O'Hare |
| I answered them anyway. Someone else may have the same question. -Blake O'Hare |
| The functions getRed, getGreen, and getBlue take in a pixel and return the numerical value of the color value. -Blake O'Hare |
| Well, the brown assignment just creates a color (or names the color (57, 16, 8) 'brown'). That's nothing to do with which pixels get changed. We happened to use that in deciding which pixels needed to be made redder because that made sense when reddening someone's hair. The visual effect in the homework is decidedly freakier. (Check out some of the posters to see this.) To decide which pixels you need to make bluer or greener or whatever in the homework example, just follow the five conditions in the bullet points in the homework statement. Colin Potts |
| If you're using a large picture, or one with lotssss of pixels (say, one straight from a digital camera), then yes, it's going to take FOREVER! Try scaling down your picture using a picture editing program first and then run it. Hopefully it'll run faster. Amanda Bennett |
| It's the INPUT to your function. This will be gone over more in recitation this week. It's a variable that is some value (or in this case a picture) that will somehow be used or manipulated in the function. Amanda Bennett |
| Check the FAQ Liz Helms |
| You need to show() your picture for the colors change to become visible. The message you receive is not an error message. We will cover return values from functions in class soon. Colin Potts |
| When you use the writePictureTo(x, path) the x is whatever your input is. In this homework, it should be titled picture, pic or some variation there of. So in the end, your writePictureTo should look like this: writePictureTo(inputted/altered picture, path). Does this make sense?? Liz Helms |
| When saving it, with the writePictureTo function, the last part, the C://blah,blah,blah.jpg, replace the blah blah blah with whatever you want your picture to be named, in this case, your gt#### number. Liz Helms |
| This is in the slides and in the textbook. I covered it in my lecture yesterday. The answer is <= and >= respectively. Colin Potts |
| Perhaps im misinterpreting your question but.... You dont write out the "average of the original red and green values". Instead, you set the blue value of a pixel to be the average of the original red and green values. Larry Olson |
| Well, how would you calculate an average of your grades for a Math class? Take that exact same method and combine it with knowledge of how to get the Red value, Blue value, or Green value from a given pixel. (Note: Have a look at the Table on pp.71 of the text and also at pp. 47 of the text.) Larry Olson |
| What's the exact error you're getting? I just uploaded a picture to the page and it worked fine. Do you have the correct username and password? Check the FAQ if that's what's incorrect. Amanda Bennett |
| They should probably be posted before Saturday, but you should email him to make sure. Bobby Mathew #2 |
| They will be posted as soon as possible. I will try to have them done before recitations but that won't always be possible. Either way, they will always be done by the Friday the week after they are due. Andrew Hardin |
| You have to open the file from inside JES. Amanda Bennett |
| This looks fine to me (but I sometimes miss errors that are staring me in the face). Are you sure that in your function p is really a pixel and that originalRed and originalGreen are really integers representing intensity values? Colin Potts |
| There's no such thing as an if loop. If you mean 'for loop', then setting original values inside it is going to re-set them each time the program goes through it. That may or may not be what you want. If you are talking about an if statement, then setting original values inside it will set them only if the if condition is true and won't set the values otherwise. Colin Potts |
| Just upload the picture you want with the correct filename. We'll worry about the rest. Larry Olson |
| So you got back the .zip file and couldnt open it? If that is the case then download a program like WinZip or IZarc and use that to open the zipped file. Note: If you are using Windows XP then this should not be an issue. Otherwise I am assuming that you have the file unzipped already but are having issues opening it in JES. If this is the case, then start JES first and then try to open the file from within JES. Hope this helps. More info would be good. Larry Olson |
| That will suffice. -Blake O'Hare |
| Everything on this line looks correct by itself, so therefore the problem is that pic is not defined. You must use the same variable that you passed into your changeColor function. -Blake O'Hare |
| ...and the problem in this case is the r is supposed to go in front of the string (without the comma) when you don't use double backslashes. Which also means you're not passing in a picture at all. It was correct in your previous example. -Blake O'Hare |
| First try opening JES first, then opening the .py file from inside JES. But it does sound like you have a serious problem here. If you try to open JES on its own and the splash screen is all you see before it just goes *poof*, then something else is wrong. If that's the case, see a TA. -Blake O'Hare |
| Make sure the final version you turn in ends with .py. -Blake O'Hare |
| Two random suggestions: (1) Say your picture is called 'pic', try putting 'print pic' before your line 'writePictureTo(pic, ...)'. This gives you some diagnostic information. How big is pic? If it's zero pixels, maybe you're not creating the picture correctly. (2) Are you sure that the saved picture really is 0 bytes long? Instead of believing the file browser, try pickAFile() to re-load your written picture file and then show it. Does it appear correctly? Colin Potts |
| The picture isn't being written to file. Double check your writePictureTo code and that you're passing it a valid picture. Also make sure the file you're uploading is, in fact, the file you wrote out from JES. -Blake O'Hare |
| Because you didn't pass in the picture. -Blake O'Hare |
| Did you use makePicture? -Blake O'Hare |
| File paths that you get from pickAFile are nothing more than strings of characters that represent the address of the file, not the actual contents. -Blake O'Hare |
| The easiest way to writePictureTo is in the white section. Are you making sure that whatever variable you are using for your input you are also using for the writePictureTo function? Once you write the picture to your computer you can then delete the line and turn in the function. -Albert d'Heurle |
| are you making sure to click the load button? -Albert d'Heurle |
| This is not going to be an issue, once you change the color of the pixel you are going to move onto the next pixel until there are no more pixels to change. -Albert d'Heurle |