Search code examples
pythonimagepsychopy

ValueError: Unrecognized Mode


Here is my code:

import Image
img = Image.new("RBG",(649,489),(0,0,255))
for x in xrange(649):
    for y in xrange(489):
        img.putpixel((x,y),(0,255,0))

img.show()

When I try to run this code I get a "ValueError: unrecognized mode", does anyone know why this might happen? Any help will be greatly appreciated. :)


Solution

  • I guess it should be "RGB" instead of "RBG".