Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import timeit
- import PIL.ImageGrab
- def get_screen():
- return PIL.ImageGrab.grab()
- def get_pixels():
- screen = get_screen()
- t = timeit.Timer()
- for x in range(1, 1000):
- for y in range(1, 500):
- PixelString = ""
- #PixelString = PIL.ImageGrab.grab().load()[300,i]
- #PixelString = PIL.ImageGrab.grab().getpixel()[300, i]
- print(screen.load()[x, y])
- print(t.timeit())
- get_pixels()
Advertisement
Add Comment
Please, Sign In to add comment