vertflip - newim.setPixel(col,row,oldpixel) return newim...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
from cImage import * def upsidedown(oldimage): oldw = oldimage.getWidth() oldh = oldimage.getHeight() newim = EmptyImage(oldw,oldh) maxp = oldh -1 for row in range(oldh): for col in range(oldw): oldpixel = oldimage.getPixel(col,maxp-row)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: newim.setPixel(col,row,oldpixel) return newim oldimage = FileImage("sonic.gif") myimwin= ImageWin("vert flip", 600, 600) newim = upsidedown(oldimage) newim.draw(myimwin) myimwin.exitOnClick()...
View Full Document

This document was uploaded on 12/14/2010.

Ask a homework question - tutors are online