Raspberry Pi Screenshots

by 10DotMatrix in Circuits > Raspberry Pi

43634 Views, 28 Favorites, 0 Comments

Raspberry Pi Screenshots

peter-mueller-surveillance-camera-sticking-out-of-pie-new-yorker-cartoon 2.jpg

Learn how to capture and view screenshots on your Raspberry Pi for project documentation. Use Scrot and ShotWell to do this solely through the command line. Scrot is a command line screen capturing application that's easy to download and use, and Shotwell is a light-weight photo viewing application.

Setup

photo (11).JPG

Connect an external monitor, keyboard, mouse, and power supply to the Pi. Make sure your Raspberry Pi has internet connection through Ethernet or WiFi.

Let the Pi boot and start the graphical user interface by typing

startx

Instal Scrot

The installation can be completed on Raspbian using a standard apt-get call

sudo apt-get install scrot

Basic Usage

2014-11-05-132309_1824x984_scrot.png
bu1.png

Scrot has many different settings, but you can instantly take a screen shot of the whole image executing the command

scrot

Scrot's default name convention will give you a date, time and resolution stamped file like:

“2014-10-05-132309_1824x984_scrot.png”.

You can specify the file name by typing

scrot example.png

The image will now be called "example", rather than “2014-10-05-132309_1824x984_scrot.png”. This command will not work if you do not specify a file extension (for example ".png"). Change the output file format by changing the extension (for example ".jpeg", ".gif", etc).

Specify File Location

Specify where screenshots are saved with the command

scrot /home/pi/Desktop/example.png

where, for example, "/home/pi/Desktop/" is the file path and "example.png" is the screenshot. Now "example.png" will be saved on the Pi's Desktop. Note that the command

scrot /home/pi/Desktop/

will fail, rather than assigning a default name to the screenshot.

Delay a Screen Shot

2014-11-05-135347_1824x984_scrot.png

To delay a screenshot, type

scrot -d 10
where 10 is the number of seconds before capturing an image. To display a countdown, add the c option
scrot -cd 10

Capture Only Part of the Screen

partial.png

Capture sections of the screen with the -s option, as can be seen in the image included, with the commands

scrot -s

or

scrot -s /home/pi/Desktop/example.png

to specify the file path. Then click and drag a box over the area you want to capture.

Capture the current window with the u option

scrot -u

Resize a Screenshot

example.png
2014-11-05-142117_1824x984_scrot.png

The -t option will create a duplicate image (or thumbnail) that is a smaller version of the primary image. The thumbnail has the same file name as the main image with an addition "-thumb" appended on the end.

For example, this command produces a screen shot and a thumbnail that is 25% smaller.

scrot -t 25 example.png

The resulting files will be example.png and example-thumb.png.

Other Scrot Commands

I've reviewed some basic Scrot features, but there are more features that can be enabled with other command line options. These, in addition to commands already reviewed, include

-h    Display additional help
-v    Get the current version
-d X  Add a delay of X seconds to the capture
-c    Add a countdown to a delayed capture
-s    Allow user to specific capture area with the mouse
-u    Capture the current active window
-q X  Specify the image quality percentage X (default 75)
-t X  Create a thumbnail version at a specified percentage size X
-e    Specify a command to run after the image is capture

Remember you can also mix and match commands.

View Screenshots With Shotwell

2014-11-05-143148_1813x835_scrot.png

To view your images, you could open the Pi's File Manager, search for your photo, and double click its icon to view it in NetSurf. However, this is time consuming. Instead, install Shotwell photo viewer to open a screenshot via the terminal with the command

sudo apt-get install shotwell

Navigate to the directory containing the picture you want to open, and open it with the command

shotwell "example.png"