The Image module


I need to crop an image on Python anywhere, which means I need the Image module.

Could you include it please.



To answer my own post... I see I can get it by doing

from PIL import Image

Please ignore me...

Actually, you've hit an interesting problem there. PIL is a funny module, with a slightly schizophrenic attitude to how you should import things from it. If you look at their handbook, the tutorial pages say that you should to this:

import Image
im ="lena.ppm")

...but the reference pages say that you should do this:

from PIL import Image
im ="bride.jpg")

This has led to a lot of confusion for a lot of people, and there are multiple packages of PIL that use different import patterns.

The from PIL import Image pattern seems to be the most generally-popular one -- and it seems cleaner because it makes it clear which package's Image class you want to use. So we use a PIL install that works that way.

That was freaky. I was reading the links in giles post above to see where they go. Being that I'm getting so accustomed to reading at first I read pythonware as pythonanywhere...☺

The tricks our minds will play on us if we're not careful...