greyscale - newPixel = Pixel(aveRGB,aveRGB,aveRGB) return...

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

View Full Document Right Arrow Icon
from cImage import * def grayPixel(oldpixel): intensitySum = oldpixel.getRed() + oldpixel.getGreen() + oldpixel.getBlue() aveRGB = intensitySum // 3
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: newPixel = Pixel(aveRGB,aveRGB,aveRGB) return newPixel newPic = grayPixel(Pixel(100, 255, 200)) print(newPic)...
View Full Document

Ask a homework question - tutors are online