lab6practice

lab6practice - height = party.getHeight() newim =...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
from cImage import * import os os.chdir ("/Network/Servers/gershwin.fandm.edu/Users/ssorr/Documents") party = FileImage ("pokemon_blastoise.gif") def redPixel (oldpixel): newred = oldpixel.getRed() newgreen = 0 newblue = 0 newPixel = Pixel (newred, newgreen, newblue) return newPixel def greenPixel (oldpixel): newred = 0 newgreen = oldpixel.getGreen() newblue = 0 newPixel = Pixel (newred, newgreen, newblue) return newPixel def bluePixel (oldpixel): newred = 0 newgreen = 0 newBlue = oldpixel.getBlue() newPixel = Pixel (newred, newgreen, newblue) return newPixel def tripleImage (image): myWin = ImageWin ("pokemon_blastoise.gif", 800, 600) image.draw(myWin) image.save('blastoise.gif') width = party.getWidth ()
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: height = party.getHeight() newim = EmptyImage (width, height) for row in range (height): for col in range (width): originalPixel = party.getPixel (col, row) newPixel = redPixel (originalPixel) newim.setPixel(col, row, newPixel) newim.setPosition(width+1,0) newim.draw(myWin) myWin.exitOnClick() width = party.getWidth () height = party.getHeight() newim = EmptyImage (width, height) for row in range (height): for col in range (width): originalPixel = party.getPixel (col, row) newPixel = greenPixel (originalPixel) newim.setPixel(col, row, newPixel) newim.setPosition(width+1,0) newim.draw(myWin) myWin.exitOnClick()...
View Full Document

This note was uploaded on 04/26/2011 for the course CPS 324 taught by Professor Safa during the Spring '11 term at Dickinson.

Page1 / 2

lab6practice - height = party.getHeight() newim =...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online