#create the mirror image of a picture # #A little geometry: The reflection of the #pixel at position X,Y is the pixel at positon #width+1-X,Y # #This corrects the error in the previous version by #setting up a second canvas on which to do the painting def mirror2(): file=pickAFile() sourcepic=makePicture(file) destpic=makePicture(file) #this was just to get a picture the same size width=getWidth(sourcepic) for px in getPixels(sourcepic): x=getX(px) y=getY(px) px2=getPixel(destpic,width+1-x,y) setColor(px2,getColor(px)) setColor(px,getColor(px2)) show(destpic)