I'm in a beginning programming class, and our project is to reduce an image to half it's size and then to double it's size.
How do I make a new picture that is the same picture as before, but with the reduced height and width?
This is the code that I have:
def main():
originalPic=makePicture(pickAFile())
show(originalPic)
w=getWidth(originalPic)
h=getHeight(originalPic)
printNow(str(w)+ " \n" + str(h))
if w % 2:
reducedW=w/2
else:
reducedW=w/2+1
printNow(reducedW)
if h % 2:
reducedH=h/2
else:
reducedH=h/2+1
printNow(reducedH)
reducedPic=makePicture(reducedW, reducedH)
show(reducedPic)