November 25th, 2004, 09:37 PM
Python Image Library
Alright, I've got it working...Kinda.
im = ImageGrab.grab(0,0,5,10)
when I take im = Image.Grab.grab(0,0,5,10) and change that to just (0) it works. I did research on the way to set it up and it is supposed to be set up as following: (x,y, width, height). What am I doing wrong. I have PIL installed and can't figure anything out. Your help is greatly appreciated.
November 26th, 2004, 06:45 AM
Your problem, as I see it is that ImageGrab.grab() takes one argument and you are trying to pass it four . From the PIL documentation, a box is a Tuple of four values so I suspect that you need to do something like this:
Obviously I can't test this myself since I'm working on a Mac and ImageGrab.grab() only works with Windows right now .
im = ImageGrab.grab((0, 0, 5, 10))
Hope this helps,
November 26th, 2004, 07:21 PM
Works Like a charm.
December 7th, 2004, 01:25 AM
Hey, Im new at this and I dont know what im doing wrong. I put the exact thing it says to put in for a screenshot but every time it does this:
>>> import sys
>>> import ImageGrab
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named ImageGrab
What should I do with the "import ImageGrab?"
December 7th, 2004, 04:48 PM
Since PIL (the Python Imaging Library) doesn't come with the standard Python distribution you'll need to install it yourself. You can download the latest version as an exe (Windows installer) from here:
You might also want to read though the "Imagine Python" article in Devsheds Python section:
December 7th, 2004, 07:05 PM
The PIP file from the website does not work for python 2.4 .I downloaded python 2.4, and I am wondering is there any way that I can get the file for (python 2.4). Or do I have to download python 2.3?
December 8th, 2004, 02:51 PM
We get this after every major release , unfortunately you only have two choices - wait for the guys to test, build and add a compatible binary or stick with 2.3 like you mentioned; not a bad idea since it's going to take a little time for all the third party modules to catch up anyway. (This usually doesn't take too long though).
Still, If you can't wait to play with the new stuff in Python 2.4 then just take the plunge and have some fun while you're waiting .
December 9th, 2004, 12:25 AM
I just downloaded version 2.3.4 so that I could get the Image Library. I've tried the ImageGrab and it works great.I was wondering if there is anyway for you to abtract an image using something like "Paint program" and paste the abstracted image on an internet game so that the picture would be there but not really the item. Am I too confusing?