Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 22, 2023. It is now read-only.

Commit fb2db8e

Browse files
Merge pull request #612 from pratik-choudhari/Screenshot
Added Screenshot script
2 parents e6845d3 + 25c23ee commit fb2db8e

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## About
2+
3+
This is a python utility script to take a screenshot of entire screen.
4+
5+
## Installing dependencies
6+
7+
`pip3 install -r requirements.txt`
8+
9+
## Run the script
10+
11+
Perform `python3 screenshot.py`, later a 3 seconds timer will start in which you can navigate to the screenshot to take screenshot of.
12+
13+
<p align = "center">
14+
<img src = 'Screenshot.png' alt = 'sample'>
15+
</p>
16+
The image gets saved in python script directory
17+
18+
## Contribution by [Pratik Choudhari](https://www.github.com/pratik-choudhari)
161 KB
Loading[フレーム]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
numpy
2+
cv2
3+
pyautogui
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import time
2+
import cv2
3+
import numpy as np
4+
import pyautogui
5+
6+
print("Taking a screenshot in 3 seconds, navigate to desired screen...")
7+
time.sleep(3)
8+
9+
# taking a screenshot
10+
image = pyautogui.screenshot()
11+
12+
# pyautogui returns a PIL image in RGB format
13+
# Convert it to BGR for saving
14+
image = cv2.cvtColor(np.array(image),
15+
cv2.COLOR_RGB2BGR)
16+
17+
# save image
18+
cv2.imwrite("Screenshot.png", image)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /