I keep getting an error message when I run this code and I don't know how to correct it.
Here's the code and below it is the error message:
import sys import Image import ImageFilter im = Image.open("7.bmp").convert("L") source = im.split() R, G, B = 0, 1, 2 # select regions where red is less than 100 mask = source[R].point(lambda i: i < 100 and 255) # process the green band out = source[G].point(lambda i: i * 0.7) # paste the processed band back, but only where red was < 100 source[G].paste(out, None, mask) # build a new multiband image im = Image.merge(im.mode, source)
Traceback (most recent call last):
File "C:\Python25\bmp.py", line 14, in <module>
out = source[G].point(lambda i: i * 0.7)
IndexError: tuple index out of range
Any suggestions? Thanks