problem4 - for grouprow in range (-1, 1):#apply these for...

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

View Full Document Right Arrow Icon
import cImage from cImage import * import os os.chdir('/Network/Servers/gershwin.fandm.edu/Users/ssorr/Documents') earth = FileImage ('Earth.gif') def smoothImage (image): oldImage = image width = oldImage.getWidth() height = oldImage.getHeight() newImage = emptyImage (width, height) pixelAccumulatorRed = 0 pixelAccumulatorGreen = 0 pixelAccumulatorBlue = 0 for row in range (1, height - 2): for col in range (1, width -2): originalPixel = oldImage.getPixel(col, 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: for grouprow in range (-1, 1):#apply these for groupcol in range (-1, 1): #applly these groupRedPixel = originalPixel.getRed() pixelAccumulatorRed = groupRedPixel + pixelAccumulatorRed groupGreenPixel = originalPixel.getGreen() pixelAccumulatorGreen = groupGreenPixel + pixelAccumulatorGreen groupBluePixel = originalPixel.getBlue() pixelAccumulatorBlue = groupBluePixel + pixelAccumulatorBlue...
View Full Document

Ask a homework question - tutors are online