Questions tagged [imagegrab]

Example Code :

from PIL import ImageGrab as ig
image = ig.grab()
image.save(path + filename)             #Images are in png format
26 questions
0
votes
0 answers

SystemError: tile cannot extend outside image

I want to read a different windows tab in my computer but it seems to not accept the coordinates that i'm putting, hte coordinates i got were using pyautogui. I'm using jupyter to code it, i'm new to python so most of this code i've found in…
0
votes
0 answers

Can't manage to get correct area selection for ImageGrab.grab() even when copying online code that is supposed to work. Multiple exemples tried

Fixed: Solution at the end. I am trying to export/save a tkinter canvas by using the ImageGrab.grab() method. However the saved image is always off by a bunch of pixels. I tried many exemples as well as my own tries. Question: Can you try to run…
GaetanG
  • 1
  • 2
0
votes
1 answer

pyscreenshot as ImageGrab doesn't work after compiling with PyInstaller to exe

When I use the code normally before compiling it works perfectly but when compiling to .exe with cxfreeze or pyinstaller and running the software freezes import pyscreenshot as ImageGrab import threading def wprint(): print("Wprint") global…
0
votes
1 answer

How can I save multiple files with python?

I'm developing a bot for telegram that keeps open, the first time it saves the file it works normally, but the second time it overwrites the previously written file. filename = str(uuid.uuid4()) def get_print(imagem): imagem = ImageGrab.grab() …
Alian
  • 1
0
votes
2 answers

PIL imagegrab().grab().crop(...) crops not the given coordinates

I´m creating a canvas on which I draw a number. Then I make a screenshot via the Pillow package and crop it in a way, only the drawn number remains. (Purpose is to predict the drawn number via a CNN) When cropping the screenshot done by the Pillow…
0
votes
1 answer

Can't import imagegrab

Hey I wanted to make a bot for the humenbenchmark aim training (https://humanbenchmark.com/tests/aim) but when I try to import imagegrab I get a really long error and I don't know what it means. The error is: `File "(Path to my python file)", line…
zon146
  • 3
  • 2
0
votes
1 answer

ImageGrab.grab not get widget of tkinter window, but screen area under it

Try to capture the image of a widget in tkinter window by following code, but just get the screen area under tkinter window. import ctypes import platform from time import sleep import tkinter as tk from PIL import ImageGrab if platform.system()…
Jason Yang
  • 11,284
  • 2
  • 9
  • 23
0
votes
1 answer

Why does PIL.ImageGrab.grab of specific window doesn't work properly?

I am trying to capture specific windows, and displaying them using ImageGrab using the following code: import cv2 import numpy as np from PIL import ImageGrab import pygetwindow import pyautogui titles = pygetwindow.getAllTitles() while(1): …
kenisvery
  • 1
  • 1
0
votes
1 answer

Why tesseract wont find this easy text in image?

I have been trying for hours to resize and change color of this image but nothing is consistently getting correct letters. Please see image below. This is a test image I'm using. The goal is to use this for automation purposes. Thanks! Larger…
0
votes
1 answer

Python OpenCV imshow Expected mat Argument

I'm trying to write a program that shows a specific position on a given window. When I run the code OpenCV gives me an error message telling me unexpected type for argument mat. I have no idea what's wrong because when I use the position value in…
Alex Rumer
  • 43
  • 1
  • 8
-1
votes
2 answers

How to decrease Image object size that dumped through pickle in Python

I'm working on a socket data transfer project. I want to watch client screen. I'm using pillow and pickle module both server and client but when I trying to send ImageGrab.grab() object, object size is 3Mb. It's very high data for transferring.…
1
2