When I use region_grabber(region), the region captured is not the one expected.
The function seems to call mss().grab(region) with arguments x1, y1, width, height, whereas it should call it with x1, y1, x2, y2.
the test I runned :
from PIL import Image
from python_imagesearch.imagesearch import *
screenshot = region_grabber((200, 200, 410, 410))
# mss.tools.to_png(screenshot.rgb, screenshot.size, output="screenshot.png") # to save the image
img = Image.frombytes("RGB", screenshot.size, screenshot.bgra, "raw", "BGRX")
img.show()
it should show a 210x210 image on screen, not a 10x10 image.
When I run it with original region_grabber that calls mss().grab(region) with arguments x1, y1, width, height, I get :
which is the unexpected result
When I comment the line region = x1, y1, width, height from the region_grabber function code, so that it calls mss().grab(region) with original arguments x1,y1, x2,y2, I get :
which is the attended result.
I did not do a Pull Request with this fix because I m rather new to Python and I dont really if I imported your project with the right dependencies. My pip freeze tells me I have version mss==6.1.0 installed.
I dont want to break behavior with old versions.
Hello,
When I use region_grabber(region), the region captured is not the one expected. The function seems to call
mss().grab(region)
with arguments x1, y1, width, height, whereas it should call it with x1, y1, x2, y2.the test I runned :
it should show a 210x210 image on screen, not a 10x10 image.
When I run it with original
region_grabber
that callsmss().grab(region)
with arguments x1, y1, width, height, I get : which is the unexpected resultWhen I comment the line
region = x1, y1, width, height
from theregion_grabber
function code, so that it callsmss().grab(region)
with original arguments x1,y1, x2,y2, I get : which is the attended result.This python-mss.readthedocs.io example also says to use x1, y1, x2, y2 as arguments for
mss().grab(region)
.I did not do a Pull Request with this fix because I m rather new to Python and I dont really if I imported your project with the right dependencies. My
pip freeze
tells me I have version mss==6.1.0 installed. I dont want to break behavior with old versions.Thanks for your read