# Recipe 32: Scaling a picture up (larger)

def copyBarbsFaceLarger():

  # Set up the source and target pictures
  barbf=getMediaPath('barbara.jpg')
  barb = makePicture(barbf)
  canvas = makeEmptyPicture(500, 600)

  # Now, do the actual copying
  sourceX = 45
  for targetX in range(100,100+((200-45)*2)):
    sourceY = 25
    for targetY in range(100,100+((200-25)*2)):
      color = getColor(getPixel(barb, int(sourceX), int(sourceY)))
      setColor(getPixel(canvas, targetX, targetY), color)
      sourceY = sourceY + 0.5
    sourceX = sourceX + 0.5
  show(barb)
  show(canvas)
  return canvas

