![]() ![]() |
| |||||||||
| This page removed for FERPA compliance | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| See a TA. Is your program saving the original or one that is modified, but not the same? Thanks! Brittany Duncan |
| It sounds to me like you are posterizing REMOVED than once. If you posterize an already posterized picture, the colors will be really weird, and I think that given the posterization rules in this homework, everything will come out blue. (I haven't checked this, but I have unerring intuition :) ) REMOVED this by deliberately running your function twice and then repainting your picture. If it looks like what you are seeing in Preview, then you know that that is what you did accidentally. Colin Potts |
| shakefist You and your unerring intuition! Student5493 |
| It's located in the FAQ. Student5493 |
| Use TSquare for your Python. (We will use this for all labs and homeworks in future.) For extra credit you can upload a posterized picture to the Coweb. Don't submit your picture on TSquare. Colin Potts |
| No. In fact, it must not show the picture. Colin Potts |
| Clarification.... let's just say that you should not do this, not that you must not. You won't be penalized if you have submitted it this way. It's generally regarded as bad practice to have a function do unrelated things, and transforming the picture followed by displaying it are not very closely related operations. You can do the show yourself separately in the command area to test your posterizeMe function, or you can write a separate function, like the test() function in the examples that I demonstrated in class and posted to the Coweb today. That function would make the picture, show it first, posterize it, repaint it afterward and maybe even write the posterized picture into a new file. That may sound like a lot of unrelated operations, but test() is really doing only one thing: testing or demonstrating the posterizeMe function. Colin Potts |
| Real soon now. (Sorry for delay.) You can upload your extra-credit picture to the CoWeb right now. Colin Potts |
| Yes. Otherwise your code will not run, but throw an error. Anything commented out with a '#' symbol will be ignored when JES runs the code. Student5493 |
| Make sure you are including a directory path, not just the new file name. If you are, try a different directory. JES behaves strangely sometimes when it comes to writing files. If you find yourself unable, visit a TAs office hours Tuesday to see if they can figure it out (as while TAs will generally not help when it comes to extra credit, if the problem lies with JES in this area, it's best to find out now, and figure out a workaround, since writing files is very important later on). Student5493 |
(1) make a duplicate of your picture file using Windows or the Mac Finder; (2) Do this in the JES command area: >>>pic = makePicture(pickAFile()) # Pick the ORIGINAL picture file >>>posterizeMe(pic) >>>show(pic) # Wow. It's posterized >>>dupFile = pickAFile() # Pick the DUPLICATE that you don't mind overwriting, NOT the original >>>writePictureTo(pic, dupFile) # Should overwrite the duplicate leaving your original untouched.
| I changed the mentions I saw of files, to images. There is one, sgammon3's, which he/she did not save correctly (the extension is missing), and I will not be touching that one, as to make it work, I would need to fix that extension, and I'm not sure how the extra credit will change because of it. Student5493 |
| JES probably compressed it REMOVED lossily (it's a word now) than I did. I didn't use writePictureTo(), because I like to be different, and I wanted to make sure it stood out nicely. (Really, I just enjoy being difficult. Don't worry about it if your image isn't as crisp, so long as the color wonkiness is the same). Student5493 |
| JES Functions->Pictures->writePictureTo() will insert the writePictureTo() function, and also pop up the little helper window on how to use the function. That's all (and possibly REMOVED than) I'm supposed to help, since this -is- extra credit. But that will give you an example that may aid you. Student5493 |
| That's fine. Double clicking a .py file won't open it in JES; you have to run JES first and open the program using the file menu. Colin Potts |
| I missed your question because you posted it at the top of the page originally. You may have answered this yourself by now by comparing your image with the others that have been posted this semester. Colin Potts |
| Please read the answers to previous questions before asking your own. Thanks! Brittany Duncan |