[Tutor] identifying graphics attributes

Eve Kotyk e.kotyk@shaw.ca
Tue, 26 Feb 2002 02:14:23 +0000


Andy W wrote:
> 
> Hi Eric,
> 
> > Is there a resource I could look to for information about using Python
> > to "examine" graphics files (like Photoshop or Illustrator documents)?
> > This will need to run on Mac OS 9, though that can be worked around if
> > necessary (I have Unix and windows machines at my disposal as well).  I
> > would appreciate any input that anyone can give -- I know it seems like
> > a pretty big project to tackle right off the bat, but I'm really
> > interested in the plausibility of something like this.
> 
> Have you looked at PIL?
> http://www.pythonware.com/products/pil/
> 
> Something simple like the following can be done to get the size of an image,
> with PIL:
> 
> import Image
> picture=Image.open("example.jpg")
> print picture.size
> 
Is Image a module specific to a particular version of Python?  When I
suggest to my interpretor (1.5.2) that it should import Image it tells
me there is no such module.  I'm particularly interested because I
discover abit of code I think would be valuable to me but it doesn't
work for the same reason...the second line is: import Image
-- 

ekotyk

http://members.shaw.ca/e.kotyk/virtualstudio.htm