I am new to python and am working with python image library. I just want to be able to open an image from the web and get the histogram from this image. Unfortunately I get the error File "new.py", line 1 and it does not work. Any idea how to get this working?
from PIL import Image import urllib
from PIL
import Image
import urllib
im = Image.open(urllib.urlopen("http://fmforums.com/forum/uploads/profile/photo-thumb-57725.jpg"))
im = im.convert("P")
print im.histogram()
The error is in the first two lines of your program.
should be
For more information about importing in python, see here.