Python 3 Script to Capture Screenshot of FullScreen or Parts as PNG Image Using pyscreenshot Library

Python 3 Script to Capture Screenshot of FullScreen or Parts as PNG Image Using pyscreenshot Library

Python 3 Script to Capture Screenshot of FullScreen or Parts as PNG Image Using pyscreenshot Library

# Program to take screenshot

import pyscreenshot

# To capture the screen
image = pyscreenshot.grab()

# To display the captured screenshot
image.show()

# To save the screenshot
image.save("image.png")
# Program for partial screenshot

import pyscreenshot

# im=pyscreenshot.grab(bbox=(x1,x2,y1,y2))
image = pyscreenshot.grab(bbox=(10, 10, 500, 500))

# To view the screenshot
image.show()

# To save the screenshot
image.save("image.png")
Share on:

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Comment