I want the RGB color information of the desktop background applications with pixels as input in between certain intervals. How can I do it?
Asked
Active
Viewed 43 times
0
-
Do you mean that you have an image and you want to the RGB of the pixels inside this image? – Anwarvic May 03 '20 at 12:45
-
Not image, but I want to get the color info of the desktop applications – Abanish Tiwari May 03 '20 at 17:43
1 Answers
1
Assuming you are on windows/macOS, you could use PIL
or it's fork Pillow
like this:
import PIL.ImgaeGrab # Pillow is also imported as PIL
x = y = 10
pixel = (x, y)
scrn = PIL.ImageGrab.grab()
scrn.getpixel(pixel)
>>> (246, 138, 30) # The result for me
For other method capturing you screen you could look here
For the time interval just use time.sleep(seconds)

theFrok
- 355
- 1
- 2
- 7