0

I want the RGB color information of the desktop background applications with pixels as input in between certain intervals. How can I do it?

Abanish Tiwari
  • 167
  • 1
  • 2
  • 14

1 Answers1

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