How can I load an image using Python Pillow?
Question: I load an image this way:

    
    
    from PIL import Image
    im = Image.open('test.png')
    

gives me the following error:

    
    
    IOError: [Errno 2] No such file or directory: 'test.png'
    

I have saved the image 'test.png' on the desktop.

So where should I save the image?


Answer: You need to give the directory where the file is located. So if you put in
desktop it should go something like this:

    
    
    Image.open('C:\Users\$(your_user_name)\Desktop\test.png')
    

or move the file "test.png" to folder where your script is.

