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 e95ab34

Browse files
Add screenshot contribution
1 parent e6845d3 commit e95ab34

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
The image gets saved in python script directory
14+
15+
## Contribution by [Pratik Choudhari](https://www.github.com/pratik-choudhari)
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 によって変換されたページ (->オリジナル) /