Hello !
I'm actually watching a tutorial on making a bot with Python using AI M, I want to take a snapshot of a specific area on my screen ( the little flash video game ) :

so I did this code :
from PIL import ImageGrab
import os
import time
def screenGrab():
x = 351
y = 237
im = ImageGrab.grab((x,y,x+645,y+484))
im.save(os.getcwd() + "\\full_snap_" + str(int(time.time()) ) + ".png", "PNG")
if __name__ == '__main__':
screenGrab()
Normally the program should be doing this :

But for whatever reason he took this instead :

As you can see, the coordinates does not correspond to what I've wrote and it looks like he zoom on the screen too.. Weird..
and I use a macbook pro with High Sierra :

I use :
Pillow 5.2.0
pip 10.0.1
python (from my terminal ) 2.7.10
and Pycharm
Can someone help me please ?? I'm desesperate...
thank you very much !
I can't replicate your problem, but here are some thoughts.
I would suggest running im = ImageGrab(), with no coordinates, and then looking at the resulting image to create the co-ordinates. Internally, ImageGrab.grab works by taking a screenshot of the whole screen, and then running crop - https://github.com/python-pillow/Pillow/blob/master/src/PIL/ImageGrab.py#L48 - https://pillow.readthedocs.io/en/5.2.x/reference/Image.html#PIL.Image.Image.crop
For me, starting with your initial image, the following coordinates produced the desired image -
x = 708
y = 497
im = im.crop((x,y,x+1272,y+960))
Note also that the coordinate system in Pillow starts at the upper left corner - http://pillow.readthedocs.io/en/5.2.x/handbook/concepts.html#coordinate-system
Ok, than you so much for your answer ! So I did im = ImageGrab() with no coordinates, and here's the result :

He screen capture the hole screen.
and for the coordinate system, I originally started with the upper left corner ( 351,237,993,738 ).
If it works with you, I don't really know what to do..
hello !
So, I enter your coordinates into my code and here's what he capture :

from PIL import ImageGrab
import os
import time
def screenGrab():
x = 708
y = 497
im = ImageGrab.grab(bbox=(x,y,x+1272,y+960))
im.save(os.getcwd() + "\\full_snap_" + str(int(time.time()) ) + ".png", "PNG")
if __name__ == '__main__':
screenGrab()
It seems good ! But Why with my coordinate it doesn't work.. ?
I take the coordinate with my mac internal screen capture ( cmd+shift+4 ) is it wrong ?
How did you get those coordinate.. ?
Thank you very much!
Okay ! I found the solution !
After reading the link you gave me http://pillow.readthedocs.io/en/5.2.x/handbook/concepts.html#coordinate-system
It says :
The Python Imaging Library uses a Cartesian pixel coordinate system
I was taking the coordinate of my screen, and not the pixel coordinate !
the internal mac screen capture ( cmd+shift+4 ), is not taking the pixel coordinate!
Now it works perfectly !
shift+ctrl+cmd+4
Most helpful comment
Okay ! I found the solution !
After reading the link you gave me http://pillow.readthedocs.io/en/5.2.x/handbook/concepts.html#coordinate-system
It says :
I was taking the coordinate of my screen, and not the pixel coordinate !
the internal mac screen capture ( cmd+shift+4 ), is not taking the pixel coordinate!
Now it works perfectly !