Write a function that will scale down just a part of the picture. Make someone’s head look smaller.
What will be an ideal response?
```
def squishTheHead (scr, x, y, w, h):
canvas = makeEmptyPicture(getWidth(scr), getHeight(scr))
for i in range(0, getWidth(scr)):
for j in range(0, getHeight(scr)):
p = getPixel(canvas, i, j)
p2 = getPixel(scr, i, j)
color = getColor(p2)
setColor(p, color)
sourceX = 0.0
for targetX in range(x,x+int(w/2)):
sourceY = 0.0
for targetY in range(y,y+int(h/2)):
px = getPixel(scr,int(sourceX),int(sourceY))
color = getColor(px)
setColor(getPixel(canvas ,int(targetX) ,int(targetY)), color)
sourceY = sourceY + 2
sourceX = sourceX + 2
show(canvas)
return canvas
```
Note: This halves the passed in area of the picture.
You might also like to view...
The text between and will be ________ when displayed on a web page
Fill in the blank(s) with correct word
The FBI became aware that a computer at Kinko's in Eagan, Minnesota had been used by Zacharias Moussaoui because it inspected Kinko's ________logs
Fill in the blank(s) with the appropriate word(s).