I am having trouble with this problem, I need to enhance the red intensity of each pixel
This is what i have
import cImage
def makeRedScale(imageFile):
myImageWindow = ImageWin("Image Processing",600,300)
oldImage = fileImage(imageFile)
oldImage.draw(myImageWindow)
width = oldImage.getWidth()
height = oldImage.getHeight()
newImage = emptyImage (width,height)
for row in range(height):
for col in range(width):
originalPixel = oldImage.getPixel(col,row)
newPixel = redPixel(originalPixel)
newImage.setPixel (col,row,newPixel)
newImage.setPosition(width + 1,0)
newImage.draw(myImageWindow)
myImageWindow.exitOnClick()
def redPixel(oldPixel):
intensitySum = oldPixel.getRed() + oldPixel.getGreen() + \
oldPixel.getBlue()
AveRGB = intensitySum//3
newPixel = pixel(AveRGB,AveRGB,AveRGB)
return newPixel