Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Homeworks-Spring 2004

Important Note:

On homeworks, you are encouraged to collaborate with your fellow students. However, if you do work with others, you must list the people you worked with in the "Notes to TA" area of the JES turnin window.

BE SURE TO TURN IN SOMETHING THAT WORKS! If your program fails with an error, it becomes very hard for the grader to give you any points at all! Turn in something that works, even if it doesn't do EVERYTHING, and you will get partial credit. If your program stops with an error without getting anything done, we are hard pressed to give you any points at all.

Homework 1:


Write a function named hw1 (and save it in a file named hw1.py) to accept a picture as input, and posterize it – reduce the number of colors. You'll do this by changing the picture's pixels as follows:

Please share your results by uploading the image to the Sp2004 HW1 Posters gallery.

Turn in your program via JES as "hw1".

Ask questions on Stuipd 101

Homework 2:


Write a function named hw2 in a file named hw2.py to create a collage of the same image at least four times fit onto the 7x95in blank JPEG. (You are welcome to add additional images, too.) One of those four copies can be the original picture. The other three should be modified forms. You can do any of

After composing your canvas, mirror the canvas (not the original pictures – all the pictures composed together). You can do it vertically or horizontally (or otherwise), in any direction – just make sure that your four base images are visible still after mirroring.

You must then make negative one half of the picture, no matter which direction you mirrored. You can mirror top-to-bottom, then negate just the right side; or mirror right-to-left, then negate the left. Your choice on either.

Your single function should make all of this happen–all of the effects and compositing must occur from the single function hw2(). IT IS PERFECTLY OKAY FOR HW2() TO USE OTHER FUNCTIONS! Your TA will only setMediaPath() and will put all your input pictures in her mediasources directory, and then execute hw2()–and will expect to see a collage get generated

Turn in your code, your original image (or images), and your resultant image as "hw2".

Please share your results by uploading the image to the Spring 2004 HW2 Collages gallery. (This isn't a requirement, but we'd love to see them!)

Ask questions on Spring 2004 Homework 2 Questions



Homework 3:


Write a function named hw3 in a file named hw3.py to generate an audio collage. You must compose together at least two separate sounds (IN TWO SEPARATE FILES), and your result must be at least three seconds long. One of the sounds must appear at least TWICE where it is changed in some way.

You have a variety of ways that you can change sounds:

For example, if I composed the words "Mark" and "Guzdial" so that the sound said "Mark kraM Guzdial," that would meet the requirements of the assignment.

You can use any sounds you want. You can use the sounds in the MediaSources directory, the words in the Speech folder on your class CD, or record your own sounds (with the MediaTools application, or with Windows Sound Recorder). (Hint1: Remember that zeroes for the sample values generate silence or pause.) (Hint2: Remember that the sampling rate is the number of samples per second. From there, you should be able to figure out.)

When you do your turnin, you MUST include your input sounds! It would probably be a good idea to turn in your audio collage, too, so that your TA can hear what it's supposed to sound like, even if your program doesn't work for the TA for some reason.

Be sure to access your sounds in your program using getMediaPath.

Turn in your program via JES as "hw3".

Please share your results by uploading the sounds (use writeSoundTo) to the Spring 2004 HW3 Audio Collages gallery.

Ask questions on Spring 2004 Homework 3 Questions


Homework 4:

Given a folder with images in it, create an index HTML page with links to each image.

You will write a function called linksPage that takes a string which is the path to a directory. You will create a page in that folder named index.html. Index.html should be an HTML page containing a link to every JPEG file in the directory.

You will also generate a thumbnail (1/4 the size in each dimension, 1/16 total area) copy of each image. You'll need to make the picture, use makeEmptyPicture to create a blank picture of the right size (1/4 of the height and 1/4 of the width), then scale down (copy, skiping some pixels) the original picture into the blank picture. Name the new image "qtr_"+the original file name, e.g., if the original file name was "fred.jpg" then save the quarter-size image as "qtr_fred.jpg". The anchor in the link to each full-size picture should be the quarter-size image.

Turn in your program via JES as "hw4". The function name should be "linksPage" and the program file name should be "hw4.py".

Ask questions on Spring 2004 Homework 4 Questions


Homework 5:

Build an animation of at least three seconds in duration (30 frames at 10 fps, or 75 frames at 25 frame per second). You must have at least THREE things in motion during this sequence. You must use at least one composited image (a JPEG image that you scale (if necesary) and copy into the image), one drawn image (a rectangle or line or text or oval or arc – anything that you draw), and a third image of your choice. One of your animated must change velocity once during the animation. If it goes from left-to-right slowly for half the animation, switch and go right-to-left or increase the speed in the second half.

Turn in your program and the composited image(s) (any images that you copied INTO your frames) via JES as "hw5". (You do not have to attach all your frames!) Your file must be named "hw5.py" and your function must be named "hw5" and accept a directory as input where the frames should be stored.

You must use more than one function in your solution. The main function will be "hw5" that takes input of a string that is a directory path. You must use at least one sub-function, so your file "hw5.py" will contain the function hw5() and at least one another.

Feel free to post your movies to Spring 2004 HW5 Movies for sharing with others.

Ask questions on Spring 2004 Homework 5 Questions


Homework 6


http://msnbc.msn.com is a popular news site. You are to write a function (named "hw6") that will input a directory as a string then:

You must use more than one function in your solution. The main function will be "hw6" that takes input of a string that is a directory path. You must use at least one sub-function.

Turn in your code as "hw6". Your filename should be "hw6.py"

Ask questions on Spring 2004 Homework 6 Questions

Links to this Page