Lab6Final - from cImage import * i import os o os.chdir

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

View Full Document Right Arrow Icon
from cImage import * f import os i os.chdir ("/Network/Servers/gershwin.fandm.edu/Users/ssorr/Documents") o blastoise = FileImage ("pokemon_blastoise.gif") b def tripleImage (image): originalImage = image height = originalImage.getHeight() width = originalImage.getWidth() redImage = EmptyImage (width, height) greenImage = EmptyImage (width, height) blueImage = EmptyImage (width, height) myWindow = ImageWin ("Image Window", width*3, height) for row in range (height): for col in range (width): allPixel = originalImage.getPixel (col, row) redPixel = Pixel(allPixel.getRed(), 0, 0) redImage.setPixel(col, row, redPixel) greenPixel = Pixel(0, allPixel.getGreen(), 0) greenImage.setPixel (col, row, greenPixel) bluePixel = Pixel(0, 0, allPixel.getBlue()) blueImage.setPixel (col, row, bluePixel) redImage.save ('red.gif') greenImage.save ('green.gif') blueImage.save ('blue.gif') redImage.draw(myWindow) greenImage.setPosition (width, 0) greenImage.draw(myWindow) blueImage.setPosition (width*2, 0) blueImage.draw(myWindow)
Background image of page 1

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

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

Page1 / 2

Lab6Final - from cImage import * i import os o os.chdir

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