The goal of the fractal project is to create something like this:

using three of your own images. This one uses a loop and loops five times.
Don't try to do this project in one big swoop. Work iteratively:
1. Write a function to scale a picture. Test
2. Write a function that draws a small picture on a larger
canvas. Test.
3. Write a function that draws the three images in three
quadrants of the large canvas.
4. Modify the function so that it scales the three pictures
and draws them again, smaller, in the first quadrant.
5. Analyze your code and see how you can put a loop into it
so that it will do the above.
You can use the JES function MakeEmptyPicture(width,height) to create an empty picture:
pic = MakeEmptyPicture(640,480) # creates a blank picture with the given dimensions.
For some reason, this function is not listed in the JES Help, but it is very important.
To draw an image on an empty canvas, do the following:
1. Determine the coordinates of the location at which you want to draw.
e.g., to draw in the right lower corner, you'd choose x and y at the center of the canvas.
call these startx, starty
2. Set up a nested loop with two sets of loop variables.
Call the source image 'src' and the target image 'target'
Use variables srcx, srcy, targetx, targety
begin srcx and srcy at 1, targetx and targety at startx, starty
Increment srcx and targetx at the same time, srcy and targety at the same time.
3. Inside the loop, get the pixel from the src, get its color, and setColor on the target, e.g.,
sourcePixel=getPixel(src,srcx,srcy)
targetPixel=getPixel(bigPic,targetx,targety)
color=getColor(sourcePixel)
setColor(targetPixel,color)
4. Always check boundaries, e.g., make sure src image small enought to fit on target image.
Instructor Demo: Ask the user for a (small) pic, and draw it at the center of a blank canvas. Solution is at:
http://www.cs.usfca.edu/~wolber/courses/110/JES/smallInMiddle.py
Scaling changes the size of a picture.
Scaling a picture down can be done by taking a sampling of the original pixels, e.g. grabbing very other pixel will reduce the dimensions in half.
Picture:
Write a function 'scale' that accepts a picture as a parameter, an amount to scale (e.g., 2 means scale down by 2X), and returns a new scaled picture. The algorithm is something like this:
1. create an empty picture, the target.
2. Loop through the pixels of the original as usual (nested loop). But increment i and j by more than 1.
3. As you look at each pixel, copy it to the target. Note, you'll need loop counters for both the original and target.
You'll probably also want a function that copies an image onto a big canvas at a particular location. The function should be similar to the instructor demo above, but be parameterized so you can draw something anywhere on the target. A function header might look like:
copypic(target, source, startx,starty)
Write this function and test it. You should be able to draw a couple of pictures on a target canvas by calling this function more than once and with different parameters.
Algorithm for Entire Fractal Program
Create a canvas big enough for four pictures in a 2x2 fashion.
Keep variables for the current width, height and
top-left coordinate of the target.
Loop
copy the pictures in the proper quadrants using the variables for current width, height and
top-left coordinate.
scale the pictures down by 2.
modify the current width, height and top-left coordinate.