I am suppose to get an image from my fluke robot and determine the color of each pixel in my image. Then if the pixel is mostly red, change it to completely green. If the pixel is mostly green, change it to completely blue. If the pixel is mostly blue, change it to completely red. This is what I am able to do, but I can't get it to work to get the image I have to change. There is no syntax error, it is just semantic I am having trouble with. I am using python.
My attempted code:
import getpixel
getpixel.enable(im)
r, g, b = im.getpixel(0,0)
print 'Red: %s, Green:%s, Blue:%s' % (r,g,b)
Also I have the picture saved like the following:
pic1 = makePicture("pic1.jpg"):
for pixel in getpixel("pic1.jpg"):
if pixel Red: %s:
return Green:%s
if pixel Green:%s:
return Blue:%s